5

I have one summery custom list in which I have lookup column of detail list.

So I am retrieve all data from it using expand it. But in detail list I also have one lookup column of personal Detail list.

Now how can I get personal Detail from lookup of summery list.

Any help will highly appreciated.

1 Answer 1

4

You can not $expand any lookup column of child list. You can only $expand all lookup column of parent list. Let say, you are querying on A list and A has a lookup column from B list. B has a lookup column from C list. So if you are querying on A list, then you can only $expand all columns of B.

/_api/web/lists/getbytitle('A')

You can not $expand any column from C. The reason is there is no direct relation between A and C.

Workaround

At first get the item Id of B list, then make another REST call to B and $expand the columns of C

/_api/web/lists/getbytitle('B')/items({ItemId})?$select={select column from c}&$expand=C

You can use SharePoint REST Client to test your query.

Update

You can make a batch request as you have many items from B.

Make batch requests with the REST APIs

9
  • i know there is no way to get nested lookup column data . i just want alternative way. you are right but i have multiple lookup so i have to call multiple time to get there id and then expand it. so i think this is not good way to call multiple request from mobile. Aug 31, 2016 at 9:13
  • alternative way is to make another GET request that I have mentioned as workaround Aug 31, 2016 at 9:16
  • yes i can achieve using your optional way but i have multiple lookup in A list then i have to get all item id from list b then from there id i have call all items to expand lookup of C.so if i have 6 item in A then i have to call 6 time in C to expand it data. Aug 31, 2016 at 9:21
  • In that case you can make a batch request Aug 31, 2016 at 9:32
  • can you please provide any example for batch request in REST Aug 31, 2016 at 9:43

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.