cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

"When a file is created" Flow for SharePoint Online - Document Locked

I have a Flow that triggers on 'When a file is created'. The goal of the Flow is to assign a property to the document. The file is created from the New menu in SPO.

 

The problem with this action is the file will be locked, of course, when the user creates the file. The file automatically opens in the browser (usually) thus is locked for editing.

 

Besides using a random retry interval on the trigger, is there any other solution available? I won't know when the document is unlocked as that would be an indeterminiate amount of time, based on user interaction with that document.

1 ACCEPTED SOLUTION

Accepted Solutions

@trevorseward 

Please see my screen shot below and give it a try.  I create a loop and run until a boolean variable equals true.  I am using the run after configuration in the set variable actions to handle the error - this should allow the Flow to proceed until it is successful.

 

Please note that I haven't tested this (short on time right now...) but I believe it will work for you.

error1.jpgerror2.jpgerror3.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

6 REPLIES 6

Disregard, the Retry Interval will not work for this as the action will simply fail. Any other thoughts?
hariskadir
New Member

Hi Trevor,

When you said “When a file is created” do you mean uploading file or creating new microsoft office document?

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Creating a new file. This action opens the file in the browser, which is the desired behavior.

 

Hi @trevorseward ,

 

This is related to the file you created the new file. If you upload a file, this problem will not occur.

Since Word online has an AutoSave mechanism, when you create a new file, even if you don't click Save button, the file will automatically save and trigger Flow.

At the same time, in order to avoid content confusion when editing files, the file will be locked, so other actions in Flow may not be able to operate on it.

You could try adding a Delay action in the Flow, waiting for the file to be edited and automatically unlocked to execute the remaining actions.

Besides, please check this similar thread and see if it helps:

https://powerusers.microsoft.com/t5/Flow-Ideas/SharePoint-Wait-for-file-to-be-unlocked/idi-p/180922

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

A delay is unreliable. This requires you to know exactly how long you must delay for. This isn't something we'll know as a user can have the file open for an indeterminate amount of time. I need a solution to detect the error, handle it, then retry periodically until it succeeds.

@trevorseward 

Please see my screen shot below and give it a try.  I create a loop and run until a boolean variable equals true.  I am using the run after configuration in the set variable actions to handle the error - this should allow the Flow to proceed until it is successful.

 

Please note that I haven't tested this (short on time right now...) but I believe it will work for you.

error1.jpgerror2.jpgerror3.jpg

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Scott

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,627)