3

Environment: SharePoint Online

I use Rest api to communicate with my lists. I must now, show a list which joins 3 lists:

List1 : ID, Title, Field1_Loockup(List2.ID)

List2 : ID, Title, Field2_Loockup(List3.ID)

List3 : ID, Title

I want like result :

List1.ID | List1.Title | List2.ID | List2.Title | List3.ID | List3.Title

How can I do?

1
  • Why Don't you use Content Search Webpart? Commented Sep 5, 2016 at 7:51

2 Answers 2

4

You can try using the expand clause

http://siteurl/_api/web/lists/getbytitle('listname')/items?$select=id,title,field1_lookup/id,field1_lookup/title&$expand=field1_lookup

I am not sure if it's possible to expand the second level i.e field2_lookup but you can try

http://siteurl/_api/web/lists/getbytitle('listname')/items?$select=id,title,field1_lookup/id,field1_lookup/title,field1_lookup/field2_lookup/id,field1_lookup/field2_lookup/title&$expand=field1_lookup,field1_lookup/field2_lookup
3
  • 1
    $expand does not work in second level. The reason is SP does not support nested query. Commented Sep 4, 2016 at 16:08
  • 1
    Yeah I thought the same Commented Sep 4, 2016 at 16:09
  • Similar question I answered few days back sharepoint.stackexchange.com/q/192432/21421 Commented Sep 4, 2016 at 16:14
0

I would suggest using Content search webpart which will be a huge boost to your application.

If all the list have same content type then search on the basis of that else use OR condition for the different content types.

In the display template you can easily manipulate the data to show in which ever fashion you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.