Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Unanswered

Getting error The file is locked for shared use by when updating the file properties

(3) ShareShare
ReportReport
Posted on by 19

Using Microsoft Flow, I am trying to set default value in a metadata column "Column_1" from a sharepoint OOTB "Created By" column whenever a new item created in a document library. Document library has certain content types associated so when I create a new document by choosing a content type, the Office online opens the document in Edit mode. 

 

I am getting below error when I try to update column "Column_1" using "Update file properties" action

 

Error 423: The file <filename.xlsx> is locked for shared use by <email id>. clientRequestId:<xxx> serviceRequestId:<xxx>

 

How can I check the status of the file if locked or not? Any help is much appreciated. 

 

 

 

 

  • steve_hendy Profile Picture
    371 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    On a Friday evening, most don't work weekends 😀

  • sarizvi Profile Picture
    6 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    Yes, but:
    1. Normally no one keeps the file open for 42 hours

    2. in case of an exception, we can create a counter and terminate after 4999 loops.

     

    However, the solution should work of almost all usual cases
    1. File Created from Template using "New >> Content Type" menu (this is where most of the challenges arise)
    2. File uploaded

  • steve_hendy Profile Picture
    371 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    That will timeout after 5000 loops of do until. 42 hours.

  • sarizvi Profile Picture
    6 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    The flow must wait out till the file is locked. To do this Create a Do Until with a 30 seconds delay to loop until the file is not locked.

     

    sarizvi_0-1718267813947.png

     

     

    Steps

    1. Initialize a Variable ‘File Locked’ as Boolean
    2. Create a Do Until Loop to check a variable ‘File Locked’ = false
    3. Inside the loop
      1. Add a 30 Seconds Delay
      2. Get file properties
      3. Set Variable File Locked to Get File Properties >> Checked Out

    sarizvi_4-1718267942643.png

     

     




  • Marianr99 Profile Picture
    15 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    Thank you so much!

  • steve_hendy Profile Picture
    371 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    This works Chris 1234 see previous thread he wrote on page 2 of replies.

     

  • Marianr99 Profile Picture
    15 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    Hello 🙂

    Did you find any solution?

     

    Thank you 

  • GerryBrimacombe Profile Picture
    12 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    I am running into a similar issue, but slightly different.

     

    I am using a Button Flow to process an Excel file and load it into a list. 

    When the Excel data is successfully loaded into the list, I want to update a Status metadata field to LOADED. Of course that Status field is part of the Excel fiel COOntent type.

     

    No sweat, right?

     

    But I am consistently getting the file is locked by me (the person running the Flow). I have added the loop as recommended by @PowerSA  above, and also detailed in this article. That works, but it takes about 6 minutes for the Flow to recognize the file as unlocked.  

     

    I love the idea of CANCEL CHECK-OUT by @russoedu , but I am getting an error "FILE IS NOT CHECKED OUT". What am I missing? I tried to check it out before my Get Excel Data From Table" action, but i get the same "FILE LOCKED" condition. Can I get the data without locking the file, or by locking it briefly and then unlocking?

     

    Thank you,

    Gerry

     

  • russoedu Profile Picture
    50 on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    Also having a similar issue, but in my case, I run an Office Script right after the file is uploaded.

     

    russoedu_0-1675692991255.png

    In this Child flow I was trying to update the properties in a loop, trying every 15 seconds.

     

    After I put the checkout / discard checkout, it's always working on the first attempt (it used to take 20).

    russoedu_1-1675693229127.png

     

     

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Getting error The file is locked for shared use by when updating the file properties

    There's no fix available, only a workaround.

    Try thinking about your flow logic differently. 
    Instead of:
    File is updated --> Send email with link

    Try something like:
    File is updated --> check if files is locked --> Locked --> Loop until lock is released  --> Send email
                                                                       --> Not locked --> Send email

    Checking if the file is locked is easy and is noted in my previous post:  
    Re: Getting error The file is locked for shared us... - Page 3 - Power Platform Community (microsoft.com)

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,651 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,999 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow