List Drive Item Contents
Prerequisite Permissions: List Drive Item Contents step need the following permissions.
| Permission type | Permission (from least to most privileged) |
|---|---|
| Delegated (work or school account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All |
| Delegated (personal Microsoft account) | Files.Read, Files.ReadWrite, Files.Read.All, Files.ReadWrite.All |
Description
This step retrieves a list of files and folders inside a specified OneDrive folder. You provide the folder path, and the step returns the item names and details. Use this step in workflows that audit folder contents, check for new files before processing, or generate inventory reports of items stored in OneDrive.
Note: Support is provided for the Personal Drive, however, the displayed error message is not correct.
Reference: https://docs.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http
Configurations
| No. | Field Name | Description |
|---|---|---|
| Configuration: | ||
| 1 | Step Name | Name of the step. This name has to be unique in a single workflow. |
| Connection: | ||
| 2 | Client ID | Select the client ID for which you want to copy a file or folder. Note: This field is mandatory for personal accounts. |
| 3 | Checkbox: Accept value as variable/static | Leave checkbox unchecked to accept Refresh Token value from a field in the previous steps of the stream using a drop down list. Else enable checkbox for Refresh Token field to appear as Text box. |
| 4 | Refresh Token | Specify the Refresh Token provided by authorization grant flow. The data type is String. This field is mandatory. |
| 5 | Button: Test Connection | Verifies whether the connection is established or not. |
| Input Tab | ||
| Input Fields: | ||
| 1 | Source Path | Provide source folder path for fetching details of the drive items. The data type is String. This field is mandatory. |
| 2 | Order By | The order by table field is used to specify the sort order of the drive items. |
| 3 | Sort On | Specify the property name on basis of which you want to sort the result. For example: name desc The following request gets the drive items and sorts them by the name field in descending order. The data type is String. This field is mandatory. |
| 4 | Sort Type | Select the sorting order of the values in ascending or descending manner. Allowed values: asc, desc The default sorting order is, ascending, that is, asc. The data type is String. The field is mandatory. |
| Output Tab: | ||
| Output Field: | ||
| 1 | JSONOutput | Define the output variable name in the field. Default output variable name: JSONOutput On successful execution, it holds the output of the plugin step in JSON format. |