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.
We did something like this, check if the file is locked, send an email to the user that has the file locked, check again after x amount of time, do this 3 times then fail and send email why it failed to the user.
I'm using this solution:
If the file is opend by another user (or yourself) and not closed, then this is not a solution as will fail anyway. But if you configure the settings to wait long enough (maby more that one day) then the chance of success is there 🙂
As I noted here: link
You use the out-of-the-box API to check if the file is locked or not, then move forward. If the file is locked, loop again...
123 is the ID of the item you want to check.
If you are creating a document archival workflow, sure, you can wait for days, but most of the business-related workflows I've ever dealt with are time sensitive.
Is Microsoft working on a better solution to this? The files I'm currently working with are time sensitive, could two connections solve the issue? i.e open with one account and update with another removing the file lock?
Is Microsoft working on what? File locking is baked into SP for a reason, and has been around for many years and versions.
In your flow, add a check to see if the file is locked, if yes, loop... There are plenty of examples on this forum and the web.
You don't have to wait hours or days for the file to be unlocked.
I know how to loop the file.. I want a solution where the excel can be opened instantly and the information in the table used straight away. If you must pry a company i work for is sent test results that are time sensitive, i want them to be on Sharepoint the minute they get the email. Im not the only one. Sorry to Ask pal, go for a walk.
I just got back from a walk, and guess what, Microsoft still hasn't fixed a decade old problem.
In all seriousness, try opening a Premier Support ticket and you might get a better answer.
There's no fix available, only a workaround.
Try thinking about your flow logic differently.
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...
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).
Keep up to date with current events and community announcements in the Power Automate community.
A great place where you can stay up to date with community calls and interact with the speakers.
Check out the latest Community Blog from the community!