Microsoft OneDrive Query

You can use this activity to get the Metadata for Drive and Drive Item, to download files, fetch recent items, and Search Items from Microsoft OneDrive.

Configuration

This tab has the following fields.

Field Description
Connection

Lists all Microsoft OneDrive connections. If no connection is found, create a Microsoft Office 365 connection.

Ownership Lists all ownership types that can be identified by Microsoft OneDrive. These include Me, Users, Groups, Drives, and Sites.
Resource Lists two resources, Drive and DriveItem. The operations vary as per the resource selected.
Operation Lists all operations available for a selected resource.

The Resources and Operations table below lists all operations available for different resources and also defines each operation in detail.

Item Identifier Lists item identifiers for the selected operation. It includes getByItemId and getByItemPath. This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Get Metadata or File Download

Desired Output User can select the output format either as a Location Url or file content in form of base64 String. This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Download

Convert to PDF (Optional radio button) User can choose to download a file in PDF format. This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Download

Resources and Operations
Resource Operation Description
Drive Get Metadata Retrieves the properties and relationships of a Drive resource.
Drive Items Get Metadata Retrieves the metadata for a DriveItem in a Drive by file system path or ID.
File Download

Downloads the contents of the primary stream (file) of a DriveItem. You can only download DriveItems with the file property.

Fetch Recent Files Lists a set of items that have been recently used by the user that is signed in. This collection includes items that are in the user's drive as well as items the user has access to from other drives.
Search Items Searches the hierarchy of items for items matching a query. You can search within a folder hierarchy, a whole drive, or files shared with the current user.

Input Settings

This tab has the required OData configuration fields to define the query parameters for the activity.

Note: This tab is valid and appears only when you select Resource as DriveItem and Operation as Fetch Recent Files or Search Items in the Configuration tab.
Field Description
Orderby Determines what values are used to order a collection of DriveItem resources. This field is visible only if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Fetch Recent Files or Search Items

Input

Field Description
idOrUserPrincipalName The identifier for the user object who owns OneDrive. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Users

groupId The identifier for the group that owns the document library. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Groups

driveId The identifier for drive requested. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Drives

siteId The identifier for the site that contains the document library. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Ownership:Sites

itemPath/itemId

File system path or ID. itemPath and itemId appear when Item Identifier is getByItemPath and getByItemId respectively.

This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:File Download or Get Metadata

searchText The query text used to search for items. Values may be matched across several fields including filename, metadata, and file content. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Search Items

odataparams > Top The number of items to return in a result set. This field is visible in the Input tab if you make the following selections in the Configuration tab:

Resource:DriveItem

Operation:Fetch Recent Files or Search Items

Output

The properties that are displayed in the Output tab schema correspond to the output of this activity and can be used as input by subsequent activities in the flow. The output of an activity is displayed for informational purposes only and cannot be modified.

Resource Operation Output Reference
DriveGet MetadataFor a detailed output reference, see JSON representation for the Drive resource type located under Microsoft OneDrive documentation.
DriveItemGet MetadataFor a detailed output reference, see JSON representation for the DriveItem resource type located under Microsoft OneDrive documentation.
Fetch Recent Files and Search Item OperationFor a detailed output reference, see Response for the List children of a driveItem in the Microsoft OneDrive documentation. located under Microsoft OneDrive documentation.
File DownloadIf you select Location Url in the Desired Output field, the output schema displays the Location field.
File DownloadIf you select base64 string in the Desired Output field, the output schema displays the Content field.