Actions13
File → Get
AI-generatedSummary
Get file metadata for a specified file in OneDrive Business or SharePoint site document library by file ID or path.
Inputs
- driveType (required) — Type of drive to access: 'user' for OneDrive Business or 'site' for SharePoint site document library.
- userId (required) — User principal name or ID (required when driveType is 'user').
- siteId (required) — SharePoint site ID (required when driveType is 'site').
- fileId (required) — File item ID or path from drive root (e.g., '/Documents/file.pdf').
Output shape
Array of objects, each containing 'json' (file metadata) and 'pairedItem' (input item index).
The file metadata is a Microsoft Graph DriveItem object. For each input item, one output item is produced.
Examples
Example 1: Get metadata of a file by ID in a user's OneDrive
driveType: user, userId: 'user@contoso.com', fileId: '01ABCD...'
Example 2: Get metadata of a file by path in a SharePoint site document library
driveType: site, siteId: 'contoso.sharepoint.com,site-id,web-id', fileId: '/Shared Documents/report.pdf'