Delete file Action in OneDrive For Business Connector.(Power Automate Cloud flows)

11/13/2023

Japanese version.

This action deletes a file on OneDrive.

How to use

Select the "OneDrive For Business" connector when adding steps to the flow.

Select "Delete file" from the "Actions" menu.

Set parameter.

Parameters.

File

Specify the ID of the file stored in OneDrive.

Select a file with the directory icon on the right.

When selected, it looks like a file path, but it is only a display and the substance is an ID.

If you delete the specified file and then create a file with the same name, it will be treated as a different file.
In such a case, an error will occur that the file does not exist, so it must be re-specified in the flow.

Dynamic content.

Set the ID of the following triggers/actions dynamic content.

Those that retrieve file contents at the same time are excluded.

Triggers.

Actions.

File Content

Specify the contents of the file to be deleted.

The contents of the file can be specified as follows.

  • Fixed text.
  • Dynamic content of other actions and triggers.

For fixed text, specify without quotation marks.

In the example below, a text file with ABCD will be created.

To delete a file by specifying its name

This action is ID specific and cannot be specified by file name.

If you want to delete by file name, first add the "List files in folder" in OneDrive For Business.

Specify the folder where the file to be deleted resides.

Add an "Apply to each" action.

Specify a dynamic content "value" for "Select an output from previous steps".

Click on "Add Action" and add a "Condition".

Specify the following.

LeftThe "name" of the dynamic content.
Centeris equal to
RightName of the file to be deleted.

Add "Delete File" in "If Yes" and specify the "ID" of the dynamic content in "File".

When the flow is saved and run in this state, it will be in a state to delete the file with the specified name if it exists.

---

Links

OneDrive For Business Connector(Power Automate Cloud flows)