SharePoint 2013 - get custom field value via REST API

I have an SPList that contains custom type columns (inherited from Lookup). When I try to get its elements through the REST API, I get the error:

/_vti_bin/client.svc/web/lists/getbyid(guid'list-id')/Items(item-id)

The value for field 'column name' of type 'custom field type' cannot be serialized.

      

REST API doesn't support custom types? Thank.

+3


source to share


2 answers


you can get the value of the search field with the expand keyword

_api/web/lists/getByTitle('Customers')/items?$select=Title,Affiliation/Id,Affiliation/Title&$expand=Affiliation

      



you can find a detailed explanation in this blog post http://www.andrewconnell.com/blog/simplifying-sharepoint-2013-rest-api

Note that the URL is different because you need to use the SharePoint 2013 API. The URL you specified is a SharePoint 2010 method to use the Rest API. It's still here in 2013.

0


source


@Oleg Bul .. Go through this article and become a pro. https://msdn.microsoft.com/en-us/magazine/dn198245.aspx : D

Several important parts of the message related to your request.

$ expand . Specifies which projected fields from the combined list will be returned.

When a SharePoint list has a search box in another list, it effectively acts as a concatenation of the two lists. You can use the $ expand option to return the projected fields from the combined list. For example, if there is a Publication field in the Books list that looks for the Name field in the Publisher list, you can return those names using this URL:

_api/web/lists/getByTitle(
  'Books')/items?$select=Title,PublishedBy/Name&$expand=PublishedBy

      




Updated ans: -

Possible solutions I can think of.

  • try using $ select = '*' to fetch all columns
  • Extend and Deploy Your Own REST Endpoint Article on Creating a REST Endpoint
  • Create a calculated column and try to copy the value of the custom lookup column as it is and get the calculated column in your query.
-2


source







All Articles