The Lists property of SPSiteDataQuery allows you to specify which list or lists you wish to query. There are several approaches you can take depending on your scenario.

Lists by GUID

If you have a specific list or lists you wish to query, you can enter the list GUID(s) directly.


<List ID=”65132c19-61c1-11df-bd29-0050c2490048”/>

<List ID=”7049c015-61c1-11df-9fb4-0050c2490048”/>


Lists by BaseType

You can specify lists by the list type.

<Lists BaseType=’0’/> // Generic List

<Lists BaseType=’1’/> // Document Library

<Lists BaseType=’3’/> // Discussion Form

<Lists BaseType=’4’/> // Surveys

<Lists BaseType=’5’/> // Issues

Lists by ServerTemplates

You can specify lists by the list template. Below are some SharePoint default server templates. If you create your own template you can use your custom template ID.

<Lists ServerTemplate=’100’ Hidden=’TRUE’/> // Generic List

<Lists ServerTemplate=’101’ Hidden=’TRUE’/> // Document Library

<Lists ServerTemplate=’102’ Hidden=’TRUE’/> // Survey

<Lists ServerTemplate=’103’ Hidden=’TRUE’/> // Links

<Lists ServerTemplate=’104’ Hidden=’TRUE’/> // Announcements

<Lists ServerTemplate=’105’ Hidden=’TRUE’/> // Contacts

<Lists ServerTemplate=’106’ Hidden=’TRUE’/> // Events

<Lists ServerTemplate=’107’ Hidden=’TRUE’/> // Tasks

<Lists ServerTemplate=’108’ Hidden=’TRUE’/> // Discussion Board

<Lists ServerTemplate=’109’ Hidden=’TRUE’/> // Picture Library

<Lists ServerTemplate=’110’ Hidden=’TRUE’/> // Data Sources

<Lists ServerTemplate=’111’ Hidden=’TRUE’/> // Site Template Gallery

<Lists ServerTemplate=’112’ Hidden=’TRUE’/> // User Information List

<Lists ServerTemplate=’113’ Hidden=’TRUE’/> // Web Part Gallery

<Lists ServerTemplate=’114’ Hidden=’TRUE’/> // List Template Gallery

<Lists ServerTemplate=’115’ Hidden=’TRUE’/> // XML Form Library

<Lists ServerTemplate=’118’ Hidden=’TRUE’/> // Custom Workflow Process

<Lists ServerTemplate=’119’ Hidden=’TRUE’/> // Wiki Page Library

<Lists ServerTemplate=’120’ Hidden=’TRUE’/> // Custom grid for a list

<Lists ServerTemplate=’140’ Hidden=’TRUE’/> // Workflow History

<Lists ServerTemplate=’150’ Hidden=’TRUE’/> // Gantt Task List

<Lists ServerTemplate=’200’ Hidden=’TRUE’/> // Meeting Series List

<Lists ServerTemplate=’201’ Hidden=’TRUE’/> // Meeting Agenda List

<Lists ServerTemplate=’202’ Hidden=’TRUE’/> // Meeting Attendees List

<Lists ServerTemplate=’204’ Hidden=’TRUE’/> // Meeting Decisions List

<Lists ServerTemplate=’207’ Hidden=’TRUE’/> // Meeting Agenda List

<Lists ServerTemplate=’210’ Hidden=’TRUE’/> // Meeting Text Box

<Lists ServerTemplate=’211’ Hidden=’TRUE’/> // Meeting Things to Bring List

<Lists ServerTemplate=’212’ Hidden=’TRUE’/> // Meeting Workspace Pages list

<Lists ServerTemplate=’300’ Hidden=’TRUE’/> // Portal Sites list

<Lists ServerTemplate=’301’ Hidden=’TRUE’/> // Blog Posts list

<Lists ServerTemplate=’1100’ Hidden=’TRUE’/> // Issue Tracking


Hidden Attribute: Set to true if you wish to include hidden lists and libraries in your search.

MaxListsLimit Attribute: Set the maximum number of lists to search.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.