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.
Do Until will run iterations till the condition value is False. Once the value becomes True, it will break out of the loop.
Here’s what the Do Until action will do –
- If you search for Control connector or the Do Until action itself, you’ll see this.
- 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.
- 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.
- 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.
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.
- Once you expand the Change limits section, you’ll see 2 parameters – Count and Timeout.
- Count will be the maximum count the iterations should run in case the value never becomes true.
- 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).
- 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 –
- Showing Sandbox or Non Production Apps in Power App mobile app
- Create a Power Apps Per User Plan Trial | Dataverse environment
- Install On-Premise Gateway from Power Automate or Power Apps | Power Platform
- Co-presence in Power Automate | Multiple users working on a Flow
- Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
- Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
- Call a Flow from Canvas Power App and get back response | Power Platform\
- FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
- Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
- Asynchronous HTTP Response from a Flow | Power Automate
- Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
- Converting JSON to XML and XML to JSON in a Flow | Power Automate