0

I'm trying to use the REST APi to get data from a sharepoint list. I first get the information about the columns: _api/Web/List<guid'some-id')/Fields. Then with this information I query the data _api/Web/Lists(guide'some-id')/Items?$top=5000. If any of the columns are of type Lookup or LookupMulti then I append the &$select=<column_name>/Title and &$expand=<column_name> to the url.

The issue is that only deferred Lookup columns can actually be returned by the REST API. If they are not then I get an error.

How can I figure out which Lookup columns are deferred or not? That way I won't try to expand those and my request won't fail.

1 Answer 1

0

Once a query is submitted, then review the returned record and each lookup field that has a '__deferred' element is available for expansion through the &$expand=Folder term as an example.

If there are no associated records within the deferred field it will still show the '__deferred' element, which indicates that there is no child record present for this items field.

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.