Showing results for 
Search instead for 
Did you mean: 
Helper I
Helper I

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.





Super User II
Super User II

Hey @kpiana 

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.




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 @kpiana 

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

Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,391)