listsMerge statement
The listsMerge statement lets you merge multiple SharePoint lists enumerated inside the results of another statement.
<listsMerge resultSet="" strict="" tableName="" expandFirstDate="" expandLastDate="" expandRecurrent="" expandMultiValuesColumn="" folder="" itemVersions="" meetingInstanceId="" multiValuesSeparator="" rowLimit="" stripHtml="" useDisplayName="" timeZone="" paging="" viewScope="" distinct=""> <referenceList title="" relativeSiteUrl="" /> <fields>...</fields> <itemVersionFields>...</itemVersionFields> <query>...</query> <statementFilters> <filter field="" LookupId="" statement="" statementField="" /> </statementFilters> </listsMerge>listsMerge attributes
Section titled “listsMerge attributes”All the listsMerge attributes are the same as the list statement, except for the resultSet attribute. For more information on those attributes, please read the “ ” chapter.
resultSet
Section titled “resultSet”The resultSet attribute specifies the name of the statement that enumerates a list of SharePoint lists.
This statement must have 2 columns used to identify the lists to merge:
- Title: contains the name of the list
- RelativeSiteUrl: contains the relative URL to the SharePoint site
strict
Section titled “strict”Determines whether to throw an exception if one of the lists to merge is inaccessible (invalid, or the user doesn’t have enough rights).
The default value is true . You can set it to false to prevent exceptions.
listsMerge elements
Section titled “listsMerge elements”The only element different from the list statement is the referenceList element. For other element documentation, please see associated documentation inside the list statement chapter.
referenceList
Section titled “referenceList”The listsMerge statement requires having a list that will be used as a reference to infer the resulting schema.
This reference list should have all fields that you want to retrieve as part of the lists merging.
The referenceList element has two attributes:
- title : used to specify the list name (see “ ” chapter for more information)
- relativeSiteUrl : used to specify the relative site url (see “ ” chapter for more information)
mergeLists statement
Section titled “mergeLists statement”Starting from version 3.8, the mergeLists statement is deprecated and replaced by the listsMerge statement. You can replicate the mergeLists behavior using the listsMerge by adding two statements:
- A list statement that queries the same list as the mergeLists
- A listsMerge statement that merges the results from the list statement