Get File Info
Retrieves detailed information about a file in OneDrive or SharePoint, including metadata, permissions, and version history.
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.
Input
- Client Id - The client ID from the Connect node (optional if using direct credentials).
- File Path or URL - OneDrive path (e.g., /Documents/file.xlsx) or SharePoint URL.
- File ID - File ID as an alternative to file path. Leave empty if using File Path or URL.
Options
- Credentials - OAuth2 credentials (optional, alternative to using Client ID).
- Include Permissions - When true, includes file sharing permissions in output. Default is false.
- Include Versions - When true, includes file version history in output. Default is false.
Output
-
File Info - Detailed file information:
Id: File IDName: File nameSize: File size in bytesWebUrl: URL to open file in browserDownloadUrl: Direct download URLCreatedDateTime: When file was createdLastModifiedDateTime: When file was last modifiedCreatedBy: Who created the fileLastModifiedBy: Who last modified the fileParentReference: Parent folder informationFile: File-specific metadata (MimeType, etc.)IsExcelFile: Boolean indicating if it's an Excel fileExtension: File extensionShared: Whether file is sharedETag: Entity tag for cachingCTag: Content tag
-
Permissions - File sharing permissions (when Include Permissions is enabled). Array of permission objects with roles, granted users, and link information.
-
Versions - File version history (when Include Versions is enabled). Array of version objects with timestamps, authors, and sizes.
Examples
Get Basic File Info:
// Input
File Path or URL: "/Documents/report.xlsx"
// Output - file_info
{
"Id": "01ABC123...",
"Name": "report.xlsx",
"Size": 52480,
"IsExcelFile": true,
"LastModifiedDateTime": "2025-01-15T10:30:00Z",
"LastModifiedBy": "John Doe"
}
Get File with Permissions:
// Input
File Path or URL: "/Shared/data.xlsx"
Include Permissions: true
// Returns file info + permissions array
Get File with Version History:
// Input
File ID: "01ABC123..."
Include Versions: true
// Returns file info + versions array
Use Cases
- Audit file metadata
- Check file permissions
- View version history
- Verify file existence and properties
- Get download URLs for files
- Check file modification dates
- Validate file access
Tips
- Use File Path for OneDrive files:
/Documents/file.xlsx - Use File Path or URL for SharePoint: full URL to the file
- Use File ID when you already have it from List Files or Get Workbook
- Include Permissions to see who has access to the file
- Include Versions to track file history
- The DownloadUrl can be used to download the file directly
Common Errors
ErrInvalidArg - "Either File Path or File ID must be provided"
- Solution: Provide either a file path or file ID
ErrNotFound - "File not found"
- Solution: Verify the file path or ID is correct
ErrForbidden - "Access denied to the file"
- Solution: Ensure you have permission to access the file
ErrInvalidArg - "Invalid file URL format"
- Solution: Check that SharePoint URLs are properly formatted