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?

2
  • 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. Commented Mar 15, 2016 at 15:00
  • 1
    You can expand just the value you need if you are worried about response size. Example: '$expand=Category/Title' Commented Mar 15, 2016 at 16:12

2 Answers 2

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();
0
-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 and acknowledge you have read our privacy policy.

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