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

Overwrite file when creating a file in SharePoint

Hey guys,

in the recent flows I created it was normal that an existing file in SharePoint was simply overwritten when it had the same name as the new file. 
Right now I am creating a flow and Automate doesn't behave like this anymore, whenever I try to create a file with the same name I get an error.
Any solutions for that?

Thanks, Julian

Frequent Visitor

In my case, I decided to skip it, wasn't critical since I was putting them into appropriately named folders.
But you could add an extra step to rename the file before copying it, or after. Adds unnecessary complexity but we're used to that.

Helper V
Helper V

@Luber I tried renaming the file before copying it but same error, file is locked for shared use, cannot rename. I've now added a delay before the Create File action, had to increment it to 9 minutes to work (hopefully) all the times, if I increase to 10, it times out. What could it be that locks that file 7-8 minutes before the flow will actually be creating (and overwriting) it?

Frequent Visitor

@Beat I've had that issue in other contexts, seems inconsistent. Then I guess try copying the file then renaming the new copy...?

hello @EnriqueC , can you kindly explain how this worked? or what does it do? 

Does it affect any long run functionalities / does it affect any data?


Kindly mention your answer.

Hi @sowmya_pv  - I do not know exactly what this does, however, it has work perfectly for the past year. One of my flows runs weekly and overwrites ~500 PDFs that are between 5MB - 50MB. No issues so far. 


Hope this helps. Regards.

Thanks a lot for your response @EnriqueC . 

this worked for me thank you so much!

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.

Users online (1,947)