Skip to main content

Upload File

Prerequisite Permissions For Upload File step on OneDrive, the following Microsoft Graph permissions are required.

Permission typePermission (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 NameDescription
1Step NameName of the step. This name has to be unique in a single workflow.
Connection:
2Client IDSelect the client ID for which you want to download a file.
Note: This field is mandatory for personal accounts.
3Checkbox: Accept value as variable/staticLeave 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.
4Refresh TokenGenerate 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.
5Button: Test ConnectionVerifies whether the connection is established or not.
Input Tab
1File To UploadProvide file path to upload.
The data type is String. This field is mandatory.
2BrowseClick button to open the dialog to select the file path to upload.
3OneDrive Folder PathSpecify 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