Reputation: 3
Need to delete the files i have stored temp in share point subfolders and I’m new to power automate please someone can help flies created in SharePoint
and if this below flow can delete the file?
Upvotes: 0
Views: 17350
Reputation: 13
After few research, i found that a http request is very effective and let you specify the file path and the filename. I needed to receive the filename from an email to delete a specific file. In the image above, i only show the filename as text but you would need to a substring action in the email body to get the filename.
As you can see, i used the "Get file metadata using path" where i only did a concat to specify the required file path and filename from compose actions : concat('/',outputs('repertoire'),'/',outputs('fichier'))
Finally, the "Send an http request to sharepoint" refer to the following Uri :
_api/web/GetFolderByServerRelativeUrl('Documents partages/Compte-rendu')/Files('outputs('Get_file_metadata_using_path')?['body/DisplayName']')
and the "display name" is selected from the Get file action.
Enjoy !
Upvotes: 0
Reputation: 193
To delete a file from a subfolder in SharePoint using Power Automate, you will need to use the "Delete File" action in a flow. Here's how to do it:
Sign in to Power Automate and create a new flow.
Select the trigger for your flow. For example, you may want to use the "When a file is created or modified" trigger to delete a file as soon as it is created in a subfolder.
In the "Action" step, search for and select the "Delete File" action.
In the "Site Address" field, enter the URL of the SharePoint site where the file is located.
In the "Folder Path" field, enter the path to the subfolder where the file is located.
In the "File Name" field, enter the name of the file you want to delete.
Save and run your flow.
Keep in mind that this action will permanently delete the file, so make sure you are certain that you want to delete it before running the flow.
Upvotes: 0