SharePoint File locks
Table of Contents
In this post I will use the following flow as an example:
So when a file is create an update to the file properties will fail with the following error message
The file “…/Document.docx” is locked for shared use by ..
When looking at the details of the Update file properties action we see a bad requst
And when we look at the retry settings we can see that the error 400 doesn’t result in a retry process kicking in.
Retrying using a child flow
To find out more about child flows please have a look at my posts about getting started with child flows.
I’m going to move my update file properties into a child flow:
And in my main flow I’m going to call my child flow instead of the update of the file properties action. As you can see both the actions look fairly similar to configure, making the replacement an easy task to complete.
So now we should end up with the following flow
And when we create a document the retries as kicking in:
And when we then close the word document that we created the flow will complete with retries. The amber warning sign will however remain in place indicating that there were retries happening before completion.
This solutions to retrying file updates when a document is kept open making it a lot easier to handle SharePoint file locks as it uses the out of the box retry mechanism available with Power Automate.
In this case I used the file properties update, but I could quite well imagine that there are other scenarios where it would be useful to retry using a child flow.