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.
On a Friday evening, most don't work weekends 😀
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
That will timeout after 5000 loops of do until. 42 hours.
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.
Steps
Thank you so much!
This works Chris 1234 see previous thread he wrote on page 2 of replies.
Hello 🙂
Did you find any solution?
Thank you
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
Also having a similar issue, but in my case, I run an Office Script right after the file is uploaded.
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).
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)
WarrenBelz
146,651
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,999
Most Valuable Professional