Skip to content

rollUpLists statement

The rollUpLists statement lets you merge multiple SharePoint lists using one operation. It lets you merge all lists sharing a common title within a site collection.

rollUpLists element has the same attributes and child elements as the list and mergeLists elements. And just like mergeLists statement, some attributes have a different meaning when used in rollUpLists element context.

<rollUpLists title="" relativeSiteUrl="" tableName="" referenceSite=""
expandFirstDate="" expandLastDate="" expandRecurrent=""
expandMultiValuesColumn="" folder="" itemVersions=""
meetingInstanceId="" multiValuesSeparator="" rowLimit=""
stripHtml="" useDisplayName="" timeZone="" viewScope="" paging=""=""
distinct="">
<fields>...</fields>
<itemVersionFields>...</itemVersionFields>
<query>...</query>
<statementFilters>
<filter field="" LookupId="" statement="" statementField="" />
</statementFilters>
<filter includeRoot="" recursive="" strict="" >...</filter>
</rollUpLists>

Title of the SharePoint list that is to be merged. Any list having this title within the entire site collection will be merged as a result of the operation.

A global variable may be used for specifying the name of the list (e.g.: list = ” $listTitle! “)

URL of the starting SharePoint site from which lists should be merged. Lists from the site specified by relativeSiteUrl attribute and its child sites (recursively) having a title like specified by the title attribute, will be merged together as the result of the operation.

A report parameter may be used for specifying the value of the attribute.

A global variable may be used too (e.g.: relativeSiteUrl = ” $siteUrl! “).

Name assigned to the data resulting from the rollUpLists operation. Using this name, you may apply further operation to this data.

The referenceSite attribute allows you to specify the list that will be used as the schema provider. The URL of the referenceSite attribute is relative to the data source URL.

Note that the referenceSite may be filtered by filter element (see below).

The filter element lets you filter the sites retrieved by the rollUpLists statement. It will significantly improve the performance when you need to only retrieve lists from specific sub-sites.

The site URLs of the filter element must be relative to the relativeSiteUrl attribute value of the rollUpLists statement. The sites can be specified using a string, a multi-values parameter, or a single-value parameters with comma separated values.

The following query will return all the data from the “Contacts 01” lists located in the “demosubsite01” and “demosubsite02” sub-sites.

<rollUpLists title="Contacts 01" relativeSiteUrl="/sites/ersdedemo/" tableName="Contacts">
<fields>ID,Title</fields>
<query></query>
<filter>demosubsite01,demosubsite02</filter>
</rollUpLists>

Some attributes are available to further customizing the filter.

Optional Boolean which determines whether to include the root site (the site specified with the relativeSiteUrl attribute) in the results. Default value is true .

Optional Boolean which determines whether to include the sub sites of the specified sites. Default value is false .

Optional Boolean which determines whether to return an error if one of the sites specified does not exist. Default value is false .

Using a specific account for enumerating web sites

Section titled “Using a specific account for enumerating web sites”

SharePoint Web Services used for enumerating web sites, need credentials with SharePoint “Browse Directories” permissions on each site and sub-site starting from the starting site specified in rollUpLists statement ( relativeSiteUrl attribute).

This is obviously a major constraint when rolling up lists items for the user running the report (when using Windows Integrated security credentials at the data source level).

To overcome this limitation, it is possible to specify an account with sufficient permissions for enumerating web sites.

Account’s login and password configuration depends on the product you currently use, please see the “ SPLogin credentials ” chapter in the product documentation.