cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RohanWadiwala
Frequent Visitor

SharePoint 'Copy File' action does not replace existing file when 'If another file is already there' flag is set to 'Replace'

Hi Team,

I'm trying to copy a excel file from one sharepoint library to a subfolder in the same library.

I want to make sure that if the file of similar name exist then it should get comletly replaced by the file being copied.

Hence, in the  SharePoint 'Copy File' action i specified the 'Relace' flag for 'If another file is already there' property.

 

But now everytime I run the flow, instead of replacing the file the original files still persist.

have u experienced this issue before? If so how did you circumvent it.

 

Ps.. I tried to delete the file using the 'Delete File' action before running the 'Copy' option, but it always gives me error saying the file is opened and cannot be deleted. 

 

Capture.PNG

6 REPLIES 6
mdevaney
Super User
Super User

@RohanWadiwala 

This sounds like a Power Automate question rather than a PowerApps question.  I suggest you close this thread and post it in the Power Automate Community instead and. You’ll get a quicker and better response over there

Link to Power Automate Community
https://powerusers.microsoft.com/t5/Get-Help-with-Power-Automate/ct-p/FL_GeneralDiscussions

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

WarrenBelz
Super User
Super User

Hi @RohanWadiwala ,

The fact that the Delete File does not work suggests that someone has it open somewhere and I think that should be your first investigation. The Flow is correct and has no other options to adjust.

You might also consider posting on the Power Automate Community.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

chsanche
Community Support
Community Support

Hi @RohanWadiwala 

 

The error is pretty straight forward, another user has that file open, that is the reason that you can't delete it. Also, as the file is opened by other users, even though the Copy File action indicates replace if the file is being used is not going to get replaced, this is by design,

 

Best Regards,

--

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution

Thanks,

I have posted it in the other forum as well.


@WarrenBelz wrote:

Hi @RohanWadiwala ,

The fact that the Delete File does not work suggests that someone has it open somewhere and I think that should be your first investigation. The Flow is correct and has no other options to adjust.

You might also consider posting on the Power Automate Community.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.


@WarrenBelz  :

Thanks for the reply.

 

I posted it in the other forum as well.

 

I already did some investigation on the delete issue but wasn't able to conclude anything specific.

The file is not opened by anyone else as I'm the sole user.

When I check the error, flow mentions that its opened by my credentials.

Since I have not opened the file, I suspect there is some issue with flow not closing the connection properly after copying or some issue with SharePoint. Thoe I'm not sure which is the case.  

 

@chsanche 

Thanks for the reply.

 

I already did some investigation on the delete issue but wasn't able to conclude anything specific.

The file is not opened by anyone else as I'm the sole user.

When I check the error, flow mentions that its opened by my credentials.

Since I have not opened the file, I suspect there is some issue with flow not closing the connection properly after copying or some issue with SharePoint. Thoe I'm not sure which is the case.

Helpful resources

Announcements
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 Solution Authors
Top Kudoed Authors
Users online (1,652)