Do Until action in Power Automate

Let’s look at what Do Until Action does in Control connector in Power Automate. In case you are a newbie or have used Power Automate till now to some extent, hopefully you find this post useful and easy to understand.

Explanation

Do Until will run iterations till the condition value is False. Once the value becomes True, it will break out of the loop.

Do Until

Here’s what the Do Until action will do –

  1. If you search for Control connector or the Do Until action itself, you’ll see this.

  2. Now, let’s see what the control parameters are and how we can use the condition to define how the Do Until will run.
    Explanation: We have a variable Text Input with value “A“.
    And, we want to run the Loop in Do Until till the value of Text Input becomes “A“.

    However, if the first iteration of the Do Until itself has Text Input = A, it will still run 1 iteration and then break out of the loop and not skip the loop right away.

  3. Now, in the body of the loop, I’m setting the value of the same variable “Text Input” = “B”.


    Here, the result will be the loop will outrun the maximum no. of iterations because the condition of Text Input = “A” was never true except for the first iteration as mentioned in #2 above.

    I’ll explain in the next section why it ran for 60 iterations.

  4. And, if we set the Text Input = “A” in the body of the loop, the first iteration will run and in the next iteration, it Text Input = “A” will be true and hence, break out of the loop and not execute any further.


    So as mentioned above, the 1st iteration will run and the next iteration will detect the true value and exit out of the loop since the loop was supposed to Run till the value of Text Input = “A


    Now, let’s look at why the iteration ran a certain number of times.

Change Limits

As you noticed by now, there’s a section called as Change Limits in the Do Until connector, let’s see what parameters can be set.

  1. Once you expand the Change limits section, you’ll see 2 parameters – Count and Timeout.

  2. Count will be the maximum count the iterations should run in case the value never becomes true.
  3. Timeout will take the time duration of how much time the loop should continue to run mentioned in https://en.wikipedia.org/wiki/ISO_8601 (ISO 8601 format).
  4. At least 1 property is mandatory for you to execute Do Until.

Hope this helps!

Here are some Power Automate posts you want to check out –

  1. Showing Sandbox or Non Production Apps in Power App mobile app
  2. Create a Power Apps Per User Plan Trial | Dataverse environment
  3. Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
  4. Co-presence in Power Automate | Multiple users working on a Flow
  5. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Call a Flow from Canvas Power App and get back response | Power Platform\
  8. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  9. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  10. Asynchronous HTTP Response from a Flow | Power Automate
  11. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  12. Converting JSON to XML and XML to JSON in a Flow | Power Automate

Thank you!

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.