Skip to main content

Delete File Or Folder

Prerequisite Permissions: For Delete File or Folder on OneDrive 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

One Drive: Delete File or Folder plugin step deletes a file or folder 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-delete?view=graph-rest-1.0&tabs=http

Configurations

No.Field NameDescription
Configuration:
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 copy a file or folder.
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 TokenSpecify the Refresh Token provided by authorization grant flow.
The data type is String. This field is mandatory.
5Button: Test ConnectionVerifies whether the connection is established or not.
Input Tab
Input Fields:
1File or Folder ID/ PathProvide OneDrive file/folder ID or path to delete file or folder The field data type is String. This is mandatory.
To delete a folder in root specify
- Documents/
Else to delete a file/folder in 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.
e.g. If OneDrive path == https://organization-my.sharepoint.com/personal/xyz/Documents/demofolder/File.xlsx
Then provide,
• Documents/demofolder/File.xlsx
• demofolder/File.xlsx