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 Automate / File "Cannot be moved ...
Power Automate
Unanswered

File "Cannot be moved because it is in locked mode"

(0) ShareShare
ReportReport
Posted on by 38

Tried to upload a excel file to sharepoint folder. After read the email addr in the excel file and get the approval from email owner, I am trying to move the excel file to anther folder, but the move action failed.

 

If I don't read the excel content, the excel file can be moved successfully. Is the any lock from system and how to solve it.

 

Any suggestion, thanks.

{"status":400,"message":"File 'Shared Documents/Submitted/xxxx.xlsx' cannot be moved because it is in locked mode.\r\nclientRequestId: 2e86bxxxxxx\r\nserviceRequestId: 2e86bbxxxxxx"}

s1.png

From the below, there is no user check out the file.

s2.png 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @alexlee1 

     

    This error occurs if the file is open in edit or read mode in the browser. Can you close the file and try once? Also, there could be a chance that one of the team members that have access to the file may have it open in  the browser and it will pop the same error. 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps 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!

  • alexlee1 Profile Picture
    38 on at

    @yashag2255 Many thanks. There is no other team member visit this site at all. And I just upload the file without opening. 

     

    Any suggestion, thanks.

  • Paulie78 Profile Picture
    8,422 Moderator on at

    @alexlee1 you can use solution that I wrote up on this post:

     

    https://powerusers.microsoft.com/t5/Building-Flows/Power-Automate-Handling-Document-is-locked-for-shared-use-by/m-p/734109#M100525

     

    Create a loop that waits for the file to become free and then executes the action. If you get stuck reach out and I will help you put it together.

  • alexlee1 Profile Picture
    38 on at

    @Paulie78 Thanks for the answer. Tried to follow the suggestion, but 'update file property' get error and stop.

    s1.png

     

    The "message" is 

    {
    "status": 400,
    "message": "The file \"https://cloudxxx.sharepoint.com/sites/xxxx/Shared Documents/Submitted/xxxxxx.xlsx\" is locked for shared use by xxxx@xxxxxxx.\r\nclientRequestId: 2017b....\r\nserviceRequestId: 2017bb...."
    }

    The email addr is from myself, but I only upload without opening.

    Also tried to change the setup of 'update file property', when run get anther error.

    s2.png

    s3.png

    When trying to delete the file from web UI, it sometime said is locked. Is there any way to force unlock. 

     

    Also tried 'check in'/'discard check out'/'stop sharing...' functions in sharepoint, still not work.

     

    Any suggestion, thanks.

     

     

     

     

     

  • Paulie78 Profile Picture
    8,422 Moderator on at

    Yes, you need to configure the step after 'update file property' to run even if 'update file property' failed. Take another look at the screeshot ( https://tachytelic.imgbb.com/ ) :

     

    Wait-Until-File-Is-Not-Locked.png

     

    So the "Set Variable" step needs to be configured to run even if "Update File Property" failed. In this way the loop will continue until it no longer reports that the file is locked.

  • larspeterson Profile Picture
    42 on at

    I did a slight variant that retries until it is able to use the move file command that I thought some might find useful. Same as mentioned, except I only update the IsDocumentLocked variable upon a success of move file and I keep delaying by two minutes until that file moves. I put in some error handling so it lets me know if it doesn't move in the end as well by putting everything in a scope block.

    Screenshot 2023-03-23 104647.png

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 378 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 273 Super User 2025 Season 2

#3
Expiscornovus Profile Picture

Expiscornovus 135 Most Valuable Professional

Last 30 days Overall leaderboard