Skip to main content

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 /Documents or /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 nodes
    • Name: File name
    • Path: Full path to the file
    • WebUrl: URL to open file in browser
    • DownloadUrl: Direct download URL
    • CreatedDateTime: When file was created
    • LastModifiedDateTime: When file was last modified
    • Size: File size in bytes
    • MimeType: File MIME type
    • Extension: File extension
    • IsExcelFile: Boolean indicating if it's an Excel file
  • Folders - Array of folder objects (when Include Folders is enabled), each containing:

    • Id: Folder ID
    • Name: Folder name
    • Path: Full path to the folder
    • WebUrl: URL to open folder in browser
    • CreatedDateTime: When folder was created
    • LastModifiedDateTime: When folder was last modified
    • Size: Folder size
    • ItemCount: 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 Id from the output with Get Workbook to open Excel files
  • Filter by .xlsx extension to find only Excel files
  • The IsExcelFile property 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