Overview
This node recursively builds a folder tree from a SharePoint site, allowing users to traverse and retrieve files and folders starting from a specified root folder. It supports returning the data as a nested tree structure, a flat list, or just folder IDs. This is useful for scenarios where you need to analyze or process the structure and contents of a SharePoint document library, such as backup, migration, or content auditing.
Use Case Examples
- Retrieve all files and folders from a SharePoint document library as a nested tree to visualize the folder hierarchy.
- Get a flat list of all items in a SharePoint drive for bulk processing or reporting.
- Fetch only folder IDs to quickly identify folder structures without file details.
Properties
| Name | Meaning |
|---|---|
| Site ID | The SharePoint site ID to access, which can be obtained from the site URL. |
| Drive ID | The ID of the SharePoint drive (document library) to traverse. If left empty, the default document library is used. |
| Root Folder Path | The starting folder path within the drive to begin traversal. Leave empty to start from the root folder. |
| Return Everything as a List | If true, returns all items as a flat list instead of a nested tree structure. |
| Return Folder IDs Only | If true, returns only folder IDs as a simple list, excluding files and other details. |
| Delay Between Requests (MS) | Delay in milliseconds between API requests to avoid rate limiting. Default is 100ms. |
| Max Items to Return | Maximum number of items (files and folders) to return. Set to 0 for unlimited. Default is 10,000. |
Output
JSON
id- The unique identifier of the item (file or folder).name- The name of the item.type- The type of the item, either 'folder' or 'file'.webUrl- The web URL to access the item in SharePoint.lastModifiedDateTime- The timestamp of the last modification of the item.parentId- The ID of the parent folder containing this item.parentPath- The path of the parent folder in SharePoint.children- An array of child items (folders/files) if the output is a nested tree structure.
Dependencies
- Requires Microsoft OAuth2 API credentials for authentication to access SharePoint via Microsoft Graph API.
Troubleshooting
- If the node returns an authentication error, ensure the Microsoft OAuth2 API credentials are correctly configured and have the necessary permissions to access SharePoint sites and drives.
- If the node returns incomplete data or fewer items than expected, check the 'Max Items to Return' parameter and increase it if needed, or set it to 0 for unlimited.
- If the node encounters rate limiting errors, increase the 'Delay Between Requests (MS)' parameter to reduce request frequency.
- If the specified 'Site ID' or 'Drive ID' is incorrect or inaccessible, the node will fail to retrieve data. Verify these IDs from the SharePoint site and drive settings.
Links
- Microsoft Graph Drive API - Official documentation for accessing drives and items in Microsoft Graph API.
- Microsoft Graph SharePoint API - Documentation on SharePoint site and drive access via Microsoft Graph API.