Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

SharePoint Library Create File Overwrite as New Version

I have a flow that grabs an attachment from a SharePoint list item and creates a copy of it in a SharePoint library using the Create File action.


I have versioning turned on for the library, but the flow always fails if the file already exists in the library:


A file with the name Case Paperwork/test_attachment.txt already exists. It was last modified by i:0#.f|membership| on 23 Jul 2020 12:40:19 -0700.
clientRequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
serviceRequestId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx


All the documentation I've been able to find indicates that the file should be updated with a new version. Is there a setting I'm missing? I've attempted adding the same file to the library manually, and I am able to add it as a new version after encountering a warning that the file already exists. Is there a way to override that warning when adding files using a flow?

Community Support
Community Support

Hi jwerderits,

I just tried from my end and file could be normally updated without any warnings. In addition, I didn't see any error output from your snapshut. Do you mean it once worked normally? 
One simply mitigation operation is appending the current date to the file name when creating/saving the file to SharePoint 

Best Regards,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply, Johnnyg.


The flow works normally when first creating the list item - that's the image I uploaded. The error occurs when a user makes an change to the list item. The goal is to have the flow run again on that list item and update the metadata columns for the file in the library. In most cases, the file won't be changing, so I want to avoid having duplicates of the file in the library since the list item may change several times. If the file does change, it should replace the old file in the library (this is why a new version would be ideal).

@jwerderits -- Hi! Did you ever find a solution for this? I am having the same issue.


I am recreating a number of SPD 2010 workflows in Power Automate. The original SPD 2010 wf was already appending a date stamp if called on to create a file that already existed in the library. This is sub-optimal, since I would expect the file to be overwritten with a new version number (versioning is turned-on for this library).


The Power Automate process creates the initial file, but simply throws an error when asked to create it again -- no new version, no datestamp, nothing!





@khumphries1 I never did get a solution and we ended up abandoning the planned functionality.

I have the same issue for the newly created flows. Old flows that were created few months ago works fine without any issue. But any new flow throws that error saying file exists with the name. I want to replace the old file with new one everytime it creates a file with the given name. File names have IDs from another list,

OK, kids -- here's how I solved it.

I can't rely on any sort of PA overwrite, so I always assume that the file already exists.

Since I know what the name of the file should be, I can attempt to delete the file -- which either succeeds or fails.

Regardless, I proceed to the next step of writing the file by configuring Run After on success or failure. If the delete failed, the file did not pre-exist and the subsequent write is successful. If the delete succeeded, the subsequent write is also successful.




So simple, yet genius.  I had the same issue, and this has resolved my problem.  I tend to overthink and overcomplicate things...



Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,475)