OneDrive Business icon

OneDrive Business

Access OneDrive Business files and folders

Folder → Search

AI-generated

Summary

Search folders in a OneDrive Business user drive or SharePoint site document library using a text query, returning only folder items.

Inputs

  • driveType (required) — Type of drive to access
  • query (required) — Search query
  • userId (required) — User principal name or ID (shown when driveType is user)
  • siteId (required) — SharePoint site ID (shown when driveType is site)

Output shape

Array of folder items matching the query, each as a paired JSON object containing the Microsoft Graph DriveItem structure. Files are filtered out; only folders are included.

Uses Microsoft Graph API /root/search(q='...') with pagination via getAllPages, filters results where !!item.folder is true.

Examples

Example 1: Search for a folder named 'Reports' in the user's OneDrive

driveType: user, userId: user@contoso.com, query: Reports

Links

Discussion