3

REST API url is

/sites/MySite/_api/web/lists/getbytitle('MyList')/items?&$top=100

I have a lookup column called Sector in the list. How to retrieve this lookup value from the success call of ajax from the given url? Is it possible to retrieve the lookup value without using $expand?

  • 1
    When we query an OData entity or collection, the default response does not include related entities. We need to use $expand option in the query string of the request. – Rohit Waghela Mar 15 '16 at 15:00
  • 1
    You can expand just the value you need if you are worried about response size. Example: '$expand=Category/Title' – Rob Windsor Mar 15 '16 at 16:12
1

It is not possible to retrieve the lookup value without using $expand!! In that case you can consider JSOM.

spListItem.get_item('{Column Name}').get_lookupValue();
-1

Without using $expand it's not possible to get lookupValue in REST API.

But hopefully you will get lookupId using REST API by selecting SectorId /sites/MySite/_api/web/lists/getbytitle('MyList')/items?$select=SectorId&$top=100

Otherwise you need to go with JSOM only.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.