cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bhitchlockfcs
Resolver II
Resolver II

Update File Properties in SharePoint handling locked file

Hi Everyone,

 

I have a Flow which is triggered on the create or update of a document in a SharePoint library.

The last step of the flow updates the file properties. The Flow fails if the file is locked by the user. How can I force a wait and/or retry until the lock is removed to ensure the document properties are updated?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bhitchlockfcs
Resolver II
Resolver II

Thanks @alrez 

 

That wasn't the right solution for my problem.

 

https://sharepains.com/2019/09/27/retrying-after-failures-in-microsoft-flow/ gave me a good start to finding the solution.

I found that the body of the failing step contained the error message and status code. So I added a Scope and configured it to run after the initial Update action failed.

 

First I parsed the JSON of the body from the failed step to get the Status code, which I assigned to a variable called ErrorStatus.

Get Error from Failed Step.png

 

I then added a Do...Until loop set to run until the ErrorStatus was 100.

Retry until Error is changed.png

I repeated the update action and configured the run after fail to update the ErrorStatus.

I then added another step configured to run after the previous step was skipped to Set the ErrorStatus to 100 to exit the loop.

 

I will probably refine this but it's doing what I need it to.

 

View solution in original post

2 REPLIES 2
alrez
Community Support
Community Support

Hi,

 

You there are a few ways that this has been answered so far but if I were you I would go with the simplest set up. Take a look at the communities post below; and copy its suggestions for your flow. It would basically run the exact same way and it should achieve what you are looking to do.

 

https://powerusers.microsoft.com/t5/Building-Flows/retry-flow-after-failure/td-p/148790

 

Regards,

 

Alex

 

-------

 

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

bhitchlockfcs
Resolver II
Resolver II

Thanks @alrez 

 

That wasn't the right solution for my problem.

 

https://sharepains.com/2019/09/27/retrying-after-failures-in-microsoft-flow/ gave me a good start to finding the solution.

I found that the body of the failing step contained the error message and status code. So I added a Scope and configured it to run after the initial Update action failed.

 

First I parsed the JSON of the body from the failed step to get the Status code, which I assigned to a variable called ErrorStatus.

Get Error from Failed Step.png

 

I then added a Do...Until loop set to run until the ErrorStatus was 100.

Retry until Error is changed.png

I repeated the update action and configured the run after fail to update the ErrorStatus.

I then added another step configured to run after the previous step was skipped to Set the ErrorStatus to 100 to exit the loop.

 

I will probably refine this but it's doing what I need it to.

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,531)