Showing results for 
Search instead for 
Did you mean: 
Kudo Collector
Kudo Collector

SharePoint 'Delete File' Action not working as expected



I am working on a workflow that moves files between site collections (See this blog post). This is all working fine except the last step where I delete the file that triggered the flow.


Using the 'file path' variable, or manually entering the path always results in a '404 Resource not found' error. When using Flow's 'browse' button to select the file to delete it tends to work fine.


No matter how I specify the path (manually, browser or variable) it always displays the exact same path and file name. The error message confirms the exact path it tried to delete.



For details see the screenshots below.




Delete Action.PNGDelete Error.PNGAny idea what is going on?

Community Support
Community Support

Hi JRitmeijer,


Just created a flow following the steps in your article, I got the same error no matter what the File Identifier is.



May I know which file are you trying to delete? My understanding is that you want to delete the file in the first site collection with the trigger “When a file is created”, but since when you create this flow, the file is not even created or exsit,  you cannot specify one file in this action. So this requirement cannot be achieved.


Best regards,

Mona Li

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



I believe your assumption is correct, I am trying to delete the file that triggered the workflow in the first site collection.


You make a very important point here. Is the Flow triggered BEFORE the file is created and the file will not be created in SharePoint until the Flow finishes, so there is nothing to delete?


If that is the case, why does it work - at least intermittently - when I use the Browse function to specify the file to delete (the file is there at design time, but I delete it before I trigger the Flow)


Also, I just added a 1 minute delay before the delete action. I see the file being created, the flow is still running (or at least waiting) at that time, but even though the file exists, I get the same error as part of the Delete action.


Regardless of what is going on, how can I reliably delete the file that triggered the workflow?


Not applicable

Hi, Did you ever find a solution to this? I have a similar problem where I am creating a .txt file purely for the purpose of creating a folder. When I go to delete the text file (as I only want to keep the folder path it has created) the file cannot be found. Even though I am using the exact same path that I used to create the file in the first place. Adding a delay does not help either.
New Member

This works for me. You can't use wildcards in the file name. It has to match exactly.  Instead of using 'File Identifier'

Place a file in the folder with the same name before you set up the Flow. Then when you add the Delete task, you will drill down to it.  I tried to add a screen shot, but it didn't work.


A file with that name has to exist in the folder before you set up the Flow task so you use the Folder icon to drill down to the file and select it. It will appear in the 'File Identifier' field something like this: /Documents/Outbound/filename.txt



Sorry for the confusion but I grabbed a screen shot showing it from scratch. Click in the file name once you get to the folder. and it will populate the field.


Not applicable

Had similar problem. If your flow is trying to delete a file it itself deleted try just create a second flow for the delete action. Worked for me. Use the filename as a filter. 

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (903)