0

I have four lists in my site. I need to get data from all these lists in CSOM (Provider hosted app). All these lists are connected linearly (one to one).

List 1 -> List 2 -> List 3 -> List 4.

for eg :

List 1

Title List2_Lookup

List 2

Title List3_Lookup

List 3

Title List4_Lookup

List 4

Title

We need to write a CAML Join Query to get the data, However all my queries were failing. Please could someone help me with the join query or show some examples to connect 4 or more lists using CAML.

1 Answer 1

0

You need to use SPSiteDataQuery instead of SPQuery. MSDN link

However,

The CSOM does not provide a mechanism for querying data across multiple lists that are not associated by a lookup field. In other words, there is no client-side functional equivalent of the SPSiteDataQuery class. If you need to perform a cross-list query from client-side code, consider creating a list view on the server that performs the list aggregation. You can then query the aggregated data from your client-side code. MSDN Link 2

It seems that you need to make 4 separate CAML queries to combine your lists.

Your Answer

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

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