Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →New SharePoint Views: Sites, AllLists, AllFiles
As of Version: 24.0.9190 of the CData Drivers and Connectors for SharePoint, the following new views have been added to the REST schema:
- Sites: The new Sites view retrieves all sites across the SharePoint domain.
- AllLists: Retrieves lists from all SharePoint sites and subsites within the domain.
- AllFiles: Retrieves files and folders from all libraries across all SharePoint sites and subsites within the domain.
This feature for the CData SharePoint Drivers was added in the March 2025 driver release and allows users to retrieve file information from all sites within a SharePoint domain. Previously, the CData SharePoint Drivers only accessed data from the SharePoint site that was specified in the URL connection property. Accessing data from subsites or other sites in your SharePoint domain required setting up multiple connections to each site when accessing file information from those sites. Now, with the newly added views, users can retrieve file information across all sites with a single connection configured.
In this article, we explore examples for querying these newly exposed views and review the data model going over the columns and their data types.
Example Implementation
Retrieve file information from all sites
To retrieve the file information for all files from all sites in your SharePoint domain, you can query the AllFiles view. The query below returns all file information for all files in the SharePoint domain.
SELECT * FROM AllFiles
Results:
| SiteURL | LibraryId | Name |
|---|---|---|
| https://cdata0.sharepoint.com | 1b31f3b1-23c8-4edd-8e5b-f3180aee8fce | Fulfillments_2025-03-17-12-08-25_0002.xml |
| https://cdata0.sharepoint.com | 1b31f3b1-23c8-4edd-8e5b-f3180aee8fce | Fulfillments_2025-03-10-15-48-41_0001.xml |
| https://cdata0.sharepoint.com | 1b31f3b1-23c8-4edd-8e5b-f3180aee8fce | Drivers_Dynamics3651_TestConnection (1).log |
| https://cdata0.sharepoint.com | 1b31f3b1-23c8-4edd-8e5b-f3180aee8fce | shopifyFullfilmentlineitem.json |
| https://cdata0.sharepoint.com | 398ad7e1-c78f-4d07-b63b-81aad54c74b7 | _MySQLV2_TestConnection (1).log |
Retrieve file information from a specific site
To retrieve all file information from a specific site, you can specify a SiteURL in a WHERE clause of your SQL statement. One way to gather the Site URLs is to query the Sites view. The following query returns the site name, site URL, and site description of all sites:
SELECT Title, SiteURL, Description FROM Sites
Results:
| Title | SiteURL | Description |
|---|---|---|
| Communication Site | https://cdata0.sharepoint.com | |
| Marketing | https://cdata0.sharepoint.com/sites/Marketing | Marketing Team |
| Product Management | https://cdata0.sharepoint.com/sites/ProductManagement | Product Management |
| Product | https://cdata0.sharepoint.com/sites/Product | Product Team |
| PreSales | https://cdata0.sharepoint.com/sites/PreSales | PreSales Team |
After retrieving the SiteURL for the Site you want to retrieve all file information from, you can include that Site URL in the WHERE clause. For example, the following query retrieves only the file information for the site 'https://cdata0.sharepoint.com/sites/product':
SELECT * FROM AllFiles WHERE SiteURL = 'https://cdata0.sharepoint.com/sites/product'
Results:
| SiteURL | LibraryId | Name |
|---|---|---|
| https://cdata0.sharepoint.com/sites/product | 1342af2b-897b-4e84-91e4-717be4622dfd | __siteIcon__.png |
| https://cdata0.sharepoint.com/sites/product | 1342af2b-897b-4e84-91e4-717be4622dfd | __siteIcon__.jpg |
| https://cdata0.sharepoint.com/sites/product | cdd6685b-4882-4435-993c-4451526bc855 | Apps |
| https://cdata0.sharepoint.com/sites/product | cdd6685b-4882-4435-993c-4451526bc855 | Yammer |
| https://cdata0.sharepoint.com/sites/product | cdd6685b-4882-4435-993c-4451526bc855 | image.png |
Retrieve file information from a specific library within a specific site
To retrieve all file information from a specific library within a site, you can add a LibraryId to the WHERE clause of your SQL statement. The Id for libraries can be gathered by querying the AllLists view. The AllLists view retrieves information about all lists that contain libraries. The following query returns list information, including libraries, in the site 'https://cdata0.sharepoint.com/sites/product':
SELECT Id, Title FROM AllLists WHERE SiteURL = 'https://cdata0.sharepoint.com/sites/product'
Results:
| Id | Title |
|---|---|
| 83056ada-2452-4b3d-af29-974393fc23b3 | appdata |
| d4c6a277-7817-4069-a390-97ec324a8ec2 | appfiles |
| 0a01493f-2de4-4535-a811-4a638c12b5e3 | Composed Looks |
| cdd6685b-4882-4435-993c-4451526bc855 | Documents |
| 633e3ffc-8ff1-421a-bd9a-bf23cf80406e | Form Templates |
After retrieving the LibraryId for the Library you want to retrieve all file information from, you can include that Id in the WHERE clause. For example, the following query retrieves only the file information for the library with the specific LibraryId specified:
SELECT * FROM AllFiles WHERE SiteURL = 'https://cdata0.sharepoint.com/sites/product' AND LibraryId = '1342af2b-897b-4e84-91e4-717be4622dfd'
Results:
| SiteURL | LibraryId | Name |
|---|---|---|
| https://cdata0.sharepoint.com/sites/product | 1342af2b-897b-4e84-91e4-717be4622dfd | __siteIcon__.png |
| https://cdata0.sharepoint.com/sites/product | 1342af2b-897b-4e84-91e4-717be4622dfd | __siteIcon__.jpg |
Note: Some results from the examples above have been truncated and reformatted for readability. The actual query results are larger, but only a representative subset of rows and columns is shown in the examples.
Data Models
Sites
| Name | Type | Description |
|---|---|---|
| SiteURL [KEY] | String | The full site path. |
| SiteCollectionId | String | The unique identifier of the site collection. |
| WebId | String | The unique identifier of the specific site within the site collection. |
| Title | String | The title of the site. |
| SiteCollectionURL | String | The URL of the site collection. |
| Description | String | The description of the item. |
| Created | Datetime | Date and time the site was created. |
| LastModified | Datetime | Date and time the site was last modified. |
| SPWebUrl | String | URL that displays the resource in the browser. |
| Author | String | The author of the site. |
| DocumentSignature | String | The document signature of the site. |
| FileExtension | String | The extension of the site's file. |
| SecondaryFileExtension | String | The secondary extension of the site's file. |
| FileType | String | The file type of the site. |
| DocId | Long | The unique identifier of the site within a geo location. |
| GeoLocationSource | String | The geo location of the site. |
| HitHighlightedSummary | String | The heighted summary of the site. |
| Importance | Long | The importance of the site. |
| IsContainer | Bool | Specifies whether the site is a folder. |
| IsDocument | Bool | Specifies whether the site is a document. |
| Path | String | The current site path. |
| Rank | Double | The rank of the site. |
| RenderTemplateId | String | The site's control render template name. |
| SiteLogo | String | The URI of the site's logo. |
| ViewsLifeTime | Long | The total view count since the site was created. |
| ViewsRecent | Long | The total view count of the site in the last 14 days. |
| WebTemplate | String | The web temple from which the site is created. |
AllLists
| Name | Type | Description |
|---|---|---|
| SiteURL [KEY] | String | URL of the SharePoint site |
| Id [KEY] | String | Unique identifier for the list |
| Title | String | Title of the list |
| BaseTemplate | Int | Template type used to create the list |
| BaseType | Int | Base type of the list |
| Description | String | Description of the list |
| Hidden | Bool | Indicates if the list is hidden |
| AllowDeletion | Bool | Indicates if the list can be deleted |
| ItemCount | Int | Number of items in the list |
| Created | Datetime | Date and time when the list was created |
| LastItemDeletedDate | Datetime | Date and time when the last item was deleted from the list |
| LastItemModifiedDate | Datetime | Date and time when the last item was modified in the list |
| LastItemUserModifiedDate | Datetime | Date and time when the last item was modified by a user in the list |
| HasUniqueRoleAssignments | Bool | Indicates if the list has unique role assignments |
| DefaultDisplayFormUrl | String | URL of the default display form for the list |
| DefaultEditFormUrl | String | URL of the default edit form for the list |
| DefaultNewFormUrl | String | URL of the default new form for the list |
| DefaultViewPath_DecodedUrl | String | Decoded URL of the default view path for the list |
| DefaultViewUrl | String | URL of the default view for the list |
| DisableCommenting | Bool | Indicates if commenting is disabled for the list |
| DocumentTemplateUrl | String | URL of the document template for the list |
| EnableAttachments | Bool | Indicates if attachments are enabled for the list |
| EnableFolderCreation | Bool | Indicates if folder creation is enabled for the list |
| EntityTypeName | String | Entity type name of the list |
| ImagePath_DecodedUrl | String | Decoded URL of the image path for the list |
| ImageUrl | String | URL of the image for the list |
| IsApplicationList | Bool | Indicates if the list is an application list |
| IsCatalog | Bool | Indicates if the list is a catalog |
| IsDefaultDocumentLibrary | Bool | Indicates if the list is the default document library |
| IsPrivate | Bool | Indicates if the list is private |
| IsSystemList | Bool | Indicates if the list is a system list |
| ListFormCustomized | Bool | Indicates if the list form is customized |
| ListItemEntityTypeFullName | String | Full name of the list item entity type |
| ParentWebPath_DecodedUrl | String | Decoded URL of the parent web path for the list |
| ParentWebUrl | String | URL of the parent web for the list |
| ReadSecurity | Int | Read security level of the list |
| ServerTemplateCanCreateFolders | Bool | Indicates if the server template can create folders in the list |
AllFiles
| Name | Type | Description |
|---|---|---|
| SiteURL [KEY] | String | URL of the SharePoint site |
| LibraryId [KEY] | String | Id of the library |
| FileId [KEY] | Int | Unique identifier of the item |
| Name | String | Name of the file |
| Title | String | Title of the item |
| FileSize | String | Size of the file |
| FileType | String | Type of the file |
| ItemType | Int | Type of the item: Invalid (-1). File (0). Folder (1). Web (2). |
| Description | String | Extended description of the item |
| Path | String | Path to the file |
| ServerRelativeURL | String | Server-relative URL of the file |
| EncodedAbsoluteURL | String | Encoded absolute URL of the file |
| CheckedOutTo | Int | ID of the user who checked out the file |
| CheckInComment | String | Comment added during check-in |
| Version | String | Version of the item |
| ContentTypeID | String | Content type ID of the item |
| UniqueId | String | Unique ID of the item |
| GUID | String | Global unique identifier of the item |
| Created | Datetime | Creation date of the item |
| CreatedBy | String | User who created the item |
| Modified | Datetime | Last modification date of the item |
| ModifiedBy | String | User who last modified the item |