Power Automate delete files in SharePoint folder

Loading

Requirement: how to delete files in SharePoint Folder using Power Automate or Microsoft Flow.

Take a SharePoint Folder in the library called Contact, so create a flow that will delete all files in the below folder.

power automate delete all files in SharePoint folder

Click on +create a flow from Home page, click on Instant flow, Provide name to the flow, Select manually trigger a flow, click on Create button.

Now retrieve files from the SharePoint library, so select Get Files (Properties only) action. Then provide the site address and Library name.

How Microsoft Flow delete all files in SharePoint folder

Now From the SharePoint library filter the folder, from which is to delete the files. So click on the Next step and select Filter Array action, then in From field provide the value from dynamic content.

Then in value select the Folder path from dynamic content, the select operator is equal to and value provide the folder path i.e. SP Document/Contact/.

Microsoft Flow delete files in SharePoint folder

Now delete all files in the SharePoint Folder, so add an Apply to each action, then provide the body from the above step. Next click on Add an action and select Delete File action, the provide the site address, and in File identifier provide the below expression.

item()?['{Identifier}']

MS Flow delete files in sharepoint folder

Now click on Save and run the flow Manually, you can see all files are deleted from the SharePoint Folder.

How MS Flow delete all files in sharepoint folder

Leave a Reply

Your email address will not be published. Required fields are marked *