Showing results for 
Search instead for 
Did you mean: 
Not applicable

Creating a static URL to a file name from Library



I have a flow that when ever a file is modified or created it duplicates those changes on a Library which has matching files. However when ever a file is modified on the list, it will delete the file from the Library and then create a new copy back onto the library.


My problem is that the files from the Library I have the URL from them on our team site page and each time a file is modified on the List and it deletes and re-creates the file on the Library, it breaks the URL. 


Is there anyway around this to ensure that the same URL will always redirect to the file from the Library? All the files in the Library maintain the same name, as well as a unique ItemID(which is pulled from the list). So technically the properties don't change when its deleted and re created, but the URL does change.


Im open to other suggestions.





Community Champion
Community Champion

Hey @Anonymous 

I haven't replicated this in Flow to 100% validate but... if you delete a document and then upload another document with the same name this would change the item ID.

Rather than deleting the file and adding a new file... could you make use the of the SharePoint 'Update File' action? That should resolve your issue




If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.


Not applicable



That would be great if I could make it update instead of delete and replace the file. I haven't been able to figure it out but I attached a preview of the part of the flow that performs this current action. Maybe you can advice me what to change in order to make it update the file. 


So the Flow goes through a condition in which if it detects that the file already exists in the Library it then deletes it from the Library and then copies and paste the file from the List to that Library. The other route of the condition if it detects that it is a new file and it doesn't exist in the Library then it just jumps to the second step of coping and pasting.


Thank you Jay!



                                                                                                                                 (Continued Below)


Hey @Anonymous 

I think you just need to incorporate the following approach... in short, try to update the file and if it fails then create the file.

To do this create a branch after the 'Update File' action... in one side of the branch add the 'Create' file action and set the run after properties so that is is only executed if the 'Update File' action fails.



If the file exists then the 'Update file' action works:




If the file doesn't exist then the 'Update file' action fails and then the 'Create File' executes.


This should have you covered 🙂




If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,681)