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

Announcements

News and Announcements icon
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:
  • Suggested answer
    Pstork1 Profile Picture
    69,665 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
    15,694 Super User 2026 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
    15,694 Super User 2026 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard