List Documents
AI-generatedOverview
The Smartgent SharePoint node's 'List Documents' operation retrieves all documents from a specified SharePoint document library path using the Microsoft Graph API. It is useful for scenarios where users need to fetch and list documents stored in SharePoint libraries, such as for document management, auditing, or integration with other workflows. For example, a user can list all documents in the root or a subfolder of a SharePoint library, optionally filtering or selecting specific fields, and limiting the number of returned items.
Use Case Examples
- List all documents in the root Documents library.
- List documents in a specific subfolder with a filter to only include PDFs.
- Retrieve a limited number of documents with selected fields like id, name, and size.
Properties
| Name | Meaning |
|---|---|
| Document Library Path | Specifies the path to the SharePoint document library or subfolder to list documents from. Use '/' for the root/main Documents library. |
| Additional Options | Optional parameters to refine the document listing, including OData filter expressions, fields to select in the response, and the maximum number of items to return. |
Output
JSON
operation- The operation performed, here 'listDocuments'.siteId- The SharePoint site ID from which documents are listed.driveId- The drive ID representing the document library.libraryPath- The path of the document library or folder queried.documents- An array of document objects retrieved, each containing properties like id, name, lastModifiedDateTime, size, webUrl, downloadUrl, and mimeType.totalCount- The total number of documents returned in the list.timestamp- The timestamp when the operation was performed.
Dependencies
- Microsoft Graph API access via OAuth2 credentials
Troubleshooting
- Authentication errors due to invalid client credentials or tenant ID. Verify API credentials and tenant configuration.
- Errors in site URL format or site not found. Ensure the SharePoint site URL is correct and accessible.
- No drives or document libraries found for the site. Confirm the site has a Documents library.
- Access denied errors when permissions are insufficient to list documents.
- Invalid filter or select expressions causing API request failures.
Links
- Microsoft Graph DriveItem resource - Documentation on the DriveItem resource used to represent files and folders in Microsoft Graph.
- List children API for DriveItem - API reference for listing children (files and folders) in a drive or folder using Microsoft Graph.