Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Deleting file in SharePoint


Have a problem deleting a file previously created in SharePoint with Flow. 

It is a delete file when item created flow; as i am using a tasklist, when a new item is created i used a different flow to create files (actually wanted just the folders but this is a good work-around) and the thing is that i want those files deleted automatically so just the folders remain. The thing is that flow does not seem to find the file. It is the only file in the library. Please prompt me for more details if you think you may have an explanation or a solution.

Thank you.

Community Support Team
Community Support Team

Re: Deleting file in SharePoint

Hi SonOfRainFall,


If I understand you correctly, you are trying to create a flow to delete a file in SharePoint library when a new item is created in list. Looks like below:



But it seems that the action “delete file” only allows us to select a certain file from the library, if you want to delete several files, it might be impossible.

If I understand you correctly, please consider to create a feature request on Flow Ideas Forum at here:


If I misunderstand you, please feel free correct me and please provide more details about your scenario for better understanding.


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Powered On

Re: Deleting file in SharePoint


Thank you for the reply.

One file is indeed what i want to delete. THe problem is, that is do not have a fixed adress for the file. I need to use dynamic content in the adress. Like so:flow_delete file.JPG




The file in question is a .txt file that is created automatically by another flow on the creation of the same item in my tasklist.

The problem is: it finds the lybrary using dynamic content, (or so the error log explains ) but it cant find the txt in the lybrary.

I tried using the following file name paramaters: .txt , dynamic values for ID, NameTag, Task Name (the same used for the adress) even all of the above with .txt at the end. Is it that it can;t find the lybrary because of dynamic content or it doesan't recocnise the file name given trough dynamic content, just a specific name?

If needed i can explain and ilustrate the whole process and folder/lybrary structure i need. Thank you.

Level: Power Up

Re: Deleting a file in SharePoint where created/modified date is greater than 3 months



Does any one have tried creating a flow to delete a file from SharePoint where in created date/modified date is greated than 3 mos/specified date?


I am trying to look for the trigger for SharePoint to delete a file but not available.


Is there a way or work around to do this?



Level: Power Up

Re: Deleting file in SharePoint



Have you found a solution for this?  I too, am having this problem.  I created the delete file step and inserted the site address.  In the File identifier field, I am able to find the file that I want to delete in the search box and it deletes the file but, if I type that same information in the box manually, it doesn't work; with or without inserting dynamic content.  I cannot hard code a file deletion because I will not know the name of the file that is being uploaded.

Level: Powered On

Re: Deleting file in SharePoint


Not sure if this helps, but I ran into this problem as well. I tried building the URL dymanically too (as I was using dynaically created folders), but it turns out we don't need to!

-Leave the Site Address as is. My Site URL is blurred out but looks like

-Use "ID" as the File Identifyer. Make sure to use the ID field from the newly created document.



Helpful resources


New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (5,006)