Upload File
Prerequisite Permissions For Upload File step on OneDrive, the following Microsoft Graph permissions are required.
Permission type | Permission (from least to most privileged) |
---|---|
Delegated (work or school account) | Files.ReadWrite, Files.ReadWrite.All |
Delegated (personal Microsoft account) | Files.ReadWrite, Files.ReadWrite.All |
Description
OneDrive: Upload File step uploads a file on 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-createuploadsession?view=graph-rest-1.0
Configuration
No. | Field Name | Description |
---|---|---|
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 download a file. 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 | Generate and specify Refresh Token. The data type is String. This field is mandatory. If checkbox above is enabled, Password field appears as Text box (enter static value or environment variable). Else, if checkbox above is disabled, Password field appears as a drop down to select fields from previous steps. |
5 | Button: Test Connection | Verifies whether the connection is established or not. |
Input Tab | ||
1 | File To Upload | Provide file path to upload. The data type is String. This field is mandatory. |
2 | Browse | Click button to open the dialog to select the file path to upload. |
3 | OneDrive Folder Path | Specify the name of OneDrive folder path where the file is to be uploaded. The data type is String. This field is mandatory. To upload file to root specify: • Documents/ Else to upload file to any other path - get OneDrive Path/ID as described in sections: • You can use the ‘Upload File’ step to get Folder/File ID as an output of step execution. For example: If OneDrive path of the folder where file is to be uploaded is: https://organization-my.sharepoint.com/personal/xyz/Documents/demofolder Then provide: • Documents/demofolder or• demofolder If file is to be uploaded on a new folder ( abc ) that is to be created on OneDrive, and the path of the new folder is:https://organization-my.sharepoint.com/personal/xyz/Documents/abc Then provide: • Documents/abc • abc |