Search code examples
c#restodatasharepoint-online

Sharepoint Lookup values


I have one sharepoint list which is using Lookup Field, whose source is pointing to other list in the same site (Master data). While using OData query i don't see that column in my result.

If I use OData url with "FieldValuesAsText" I can see data. Also, I have tried using ContentType Expand and filter but i have no luck in finding.

Since, my list is very big and want to retrieve data in minimum number of calls. looking for some kind of approach or URL which will help me achieve the same


Solution

  • Try to expand look up field to get real value like this:

    /_api/web/lists(guid'')/items?$select=Title,LookupFieldName1/FieldToBeExpanded1,LookupField2/FieldToBeExpanded2&$expand=LookupFieldName1,LookupFieldName2

    In this endpoint, FieldToBeExpand1 should be the same as the column where lookup get from:

    enter image description here