web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SharePoint 'Copy File'...
Power Apps
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 27

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

Categories:
I have the same question (0)
  • mdevaney Profile Picture
    29,989 Moderator on at

    @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 Profile Picture
    153,026 Most Valuable Professional on at

    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.

  • Christopher S Profile Picture
    on at

    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!

  • RohanWadiwala Profile Picture
    27 on at

    Thanks,

    I have posted it in the other forum as well.

  • RohanWadiwala Profile Picture
    27 on at

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

     

  • RohanWadiwala Profile Picture
    27 on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard