Actions13
File → Search
AI-generatedSummary
Search files in OneDrive Business or SharePoint site drive using a query string
Inputs
- driveType — Type of drive to access; defaults to 'user' if not specified. 'user' accesses the authenticated user's OneDrive; 'site' accesses a SharePoint site's document library.
- userId (required) — User principal name or ID. Shown only when driveType is 'user'. Required to identify the user's drive.
- siteId (required) — SharePoint site ID in the form contoso.sharepoint.com,site-id,web-id. Shown only when driveType is 'site'. Required to identify the site drive.
- query (required) — Search query string, e.g. 'report.pdf'. Used in the Microsoft Graph API search endpoint.
Output shape
Array of Microsoft Graph DriveItem objects for matching files, paginated and filtered to exclude folders. Each item contains json with the file's DriveItem payload and pairedItem referencing the input index.
Results are obtained via
graphClient.getAllPageson${drivePath}/root/search(q='${encodeURIComponent(query)}'), then filtered where!!item.fileis true. Pagination follows@odata.nextLinkautomatically.