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