Microsoft Flow – Mystery of Do Until loop

Building solutions based of Microsoft Flow some times remind me of orchestration products.

If you follow the logical approach you can do wonders and automate many things using Microsoft flow.

This week I was working with one of the flow automation where I had a need to use DO UNTIL loop but  I was not successful unless number of tries and research on internet so want to share the learning on how to make DO Until to work correctly.

Few things to make DO UNTIL to work.

  • Do not use Blank value
  • Status is equal to CheckPassed means that until the value gets equal to Check passed keep on Running.(This is where many users on the Internet got stuck as DO UNTIL was not working because they were just setting the Status value in the list to the value they have defined in the loop statement where as its other way round that it should not equal to that value to make it running)
  • Add delay as per your requirement.
  • Get-item is used to refresh list value from SharePoint.(i.e. get new value) — This is the second important point to always use refreshed value
  • Status that is used in DO UNTIL should be from Get-item that you have added in DO UNTIL function. — This is the last important point to take care of.

There are other things to take care with this loop:

  • By default DO UNTIL iterations are 60 and time out is 1 hr.
  • You can change that by clicking Change limits.

  • Count can be changed to max 5000 iterations.
  • You can change the PT1H to PT24H i.e. 24 hrs or PT72H means 72 hrs.


If you follow this approach than your DO UNTIL loop will work correctly.

Thank You for reading

Sukhija Vikas

10 thoughts on “Microsoft Flow – Mystery of Do Until loop

  1. Hi Vikas,
    Thanks for sharing this. I am trying to implement the solution but getting it wrong somewhere. I have used email before and after do until and I do a one minute pause in Do until. Get items is on the same library.
    I am not able to share a screen shot with, let me know if I can share the screen shot to let you know the exact configuration of the Flow.
    Thanks in advance for the help.

      • My DoUntil starts with checking for a variable ‘x’ status. Once the status is changed from 0 to 1 the DoUntil should stop. I can’t use GetItem since it utilize sharepoint while mine compares with variable created inside the Flow.

        any ideas?

  2. Pingback: Microsoft Flow – Mystery of Do Until loop | Cloud Computers Guide

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s