web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Automate
Suggested Answer

Do Until action fails

(0) ShareShare
ReportReport
Posted on by 9
I have a flow that takes data from an Excel file and adds it to a SP List.
After the add to list action completes, I use a Do Until action to move the Excel file to an archive folder. The Do Until tests to see if the Excel file is still locked and when it's not locked, the file is archived.
I get an error (after 6 or 7 minutes) "Action 'Move_file' failed" "Microsoft.SharePoint.SPFileLockException: The file ... is locked for shared use ...".
When I check the 'archive' folder, the file was actually moved correctly. If I look at the flow status history, it says the flow run failed.
 
Is there any way to modify the Do Until so it doesn't throw the error?
 
 
 
Thanks in advance for any suggestions!
Categories:
I have the same question (0)
  • Suggested answer
    Pstork1 Profile Picture
    68,729 Most Valuable Professional on at
    Review and change the looping limits on the Do Until. By default it will only loop 60 times and times out after one hour. I suspect you are processing more than 60 rows and that is why the loop is failing.
     

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    Add a parallel branch after the Move file action. In the parallel branch, add a delay action and set the delay to 7 minutes. Configure the delay to only run if the Move file action fails. That should solve your problem. Without the delay, the do until action tries 60 times, once every second, before it fails. By adding the delay, the wait will be long enough to release the lock on your file. In addition, it will try every 7 minutes up to 60 times thus extending the timeout limit of the Do until action from 60 seconds to 420 minutes.
  • mwyller1 Profile Picture
    9 on at
    Thanks very much for the reply!
     
    I added the Parallel branch. How do I configure it to "only run if the Move file action fails."?
    The only fields in the action are "Count" and "Unit".
  • David_MA Profile Picture
    12,982 Super User 2025 Season 2 on at
    To set the delay to only run if the action above fails, click on the three dots of the delay action and choose Configure Run After from the menu. It will open this:
    Uncheck is successful and check has failed.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard