Query Multiple Lists

  • 7 February 2023
  • 1 reply


Suppose I want to query multiple list in a Site to get a list of all the documents where modified date is before 2018 . How to achieve the same?

1 reply

Userlevel 5
Badge +14

While you technically can get a CAML Query to return the results of multiple lists at once, there is no way to parse that information out via the Query List workflow action. So, you’ll need to make individual Queries per list. 

That said, if you were looking to construct a CAML Query to find all of the documents in a given Library that were before some date, the following should suffice:

<List Title="****Target List Name****" />
<FieldRef Name="FileLeafRef" />
<FieldRef Name="Last_x0020_Modified" />
<Value Type="DateTime">2018-01-01</Value>
<FieldRef Name="ContentType" />
<Value Type="Computed">Document</Value>
<ViewAttributes Scope="RecursiveAll" />


(Note 1: If you wanted IDs instead of the file names then you could replace the FieldRef Name=”FileLeafRef” with FieldRef Name=”ID” instead)


(Note 2: You’ll need to change the ****Target List Name**** to whatever list name that you’re trying to target. Keep the double quotes!)


Let me know if that helps or if you need additional help!