SharePoint Asked on November 28, 2021
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 :
Title List2_Lookup
Title List3_Lookup
Title List4_Lookup
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.
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.
Answered by George Andrews on November 28, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP