List Files
Lists files and folders from OneDrive or SharePoint. This node helps you discover and locate Excel files before performing operations on them.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is set to true, no error is caught when the project is executed even if a Catch node is used.
Input
- Client Id - The client ID from the Connect node (optional if using direct credentials).
- Site URL - SharePoint site URL. Leave empty to use OneDrive. Format:
https://company.sharepoint.com/sites/sitename - Folder Path - Path to the folder to list files from. Use
/for root, or specific paths like/Documentsor/Shared Documents/Reports.
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
- File Extension Filter - Filter files by extension (e.g.,
.xlsx,.pdf). Leave empty to list all files. - Include Folders - When true, includes subfolders in the output. Default is false.
- Max Items - Maximum number of items to return. Default is 100.
Output
-
Files - Array of file objects, each containing:
Id: File ID for use with other nodesName: File namePath: Full path to the fileWebUrl: URL to open file in browserDownloadUrl: Direct download URLCreatedDateTime: When file was createdLastModifiedDateTime: When file was last modifiedSize: File size in bytesMimeType: File MIME typeExtension: File extensionIsExcelFile: Boolean indicating if it's an Excel file
-
Folders - Array of folder objects (when Include Folders is enabled), each containing:
Id: Folder IDName: Folder namePath: Full path to the folderWebUrl: URL to open folder in browserCreatedDateTime: When folder was createdLastModifiedDateTime: When folder was last modifiedSize: Folder sizeItemCount: Number of items in the folder
-
Total Count - Total number of items returned (files + folders).
Examples
List Excel Files in OneDrive:
// Input
Client Id: ${client_id}
Folder Path: "/Documents"
File Extension Filter: ".xlsx"
// Output - files array
[
{
"Id": "01ABC123...",
"Name": "Sales Report.xlsx",
"IsExcelFile": true,
"Size": 52480,
"LastModifiedDateTime": "2025-01-15T10:30:00Z"
}
]
List All Files in SharePoint:
// Input
Site URL: "https://company.sharepoint.com/sites/finance"
Folder Path: "/Shared Documents"
Include Folders: true
// Returns both files and folders
Find Specific File Type:
// List only PDF files
File Extension Filter: ".pdf"
// List only Excel files
File Extension Filter: ".xlsx"
Use Cases
- Find Excel files before processing them
- Discover available reports in a SharePoint library
- Monitor folders for new files
- Build file selection lists for users
- Audit file repositories
Tips
- Use the
Idfrom the output with Get Workbook to open Excel files - Filter by
.xlsxextension to find only Excel files - The
IsExcelFileproperty helps identify Excel files even with different extensions - For SharePoint, ensure your site URL includes the full path:
https://domain.sharepoint.com/sites/sitename - Use folder path
/to list root directory contents - OneDrive paths use forward slashes (/) like:
/Documents/Reports
Common Errors
ErrNotFound - "Folder not found"
- Solution: Verify the folder path exists and uses correct forward slash format
ErrForbidden - "Access denied to the requested resource"
- Solution: Ensure your app has proper permissions and you have access to the site/folder
ErrInvalidArg - "Invalid SharePoint site URL format"
- Solution: Use full SharePoint URL format:
https://company.sharepoint.com/sites/sitename
ErrInvalidArg - "Invalid site URL format"
- Solution: Check that the site URL is properly formatted and accessible