cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Do until do not working properly

Hi community,

 

Recently, I was creating a new flow to use as a approval flow following a simples list on my SharePoint.

 

The ideia is, while an item is with "Pending" or "Select" value, the loop makes a follow up every 1 hour (at the screenshot is 30s jut to test), but after I change the field to another option, the loop continous and don't get out of it. I've been tried a lot of different ways, and get only to ways:

#1 the loop goes forever, and the value that I change is irrelevant

#2 the loop repeat just 1 time and goes out of it

 

Capture.PNG

8 REPLIES 8
Dual Super User
Dual Super User

Re: Do until do not working properly

Hi

I guess the dynamic content "Capacity requir..." evaluated in the Do Until is taken from the Trigger and is not updated, unless you declare a variable before the do until, initialize it with the value coming from the trigger, use this variable in the Do Until instead, include inside the Do Until a Get item, then set the variable value to the dynamic content "Capacity requir..." obtained from "Get item".

 

In such a case, I would also move "Send email" after the Do Until, ensuring it is executed due to the status changed, and not due to Do Until reached any of the limits.

Hope this helps



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Dual Super User
Dual Super User

Re: Do until do not working properly

Hi again
This post can be useful to understand the relationship between do until and variables

https://www.google.es/amp/s/elbruno.com/2017/05/30/flow-manejo-simple-de-variables-en-microsoft-flow...

Hope this helps


Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Community Support Team
Community Support Team

Re: Do until do not working properly

Hi @lsasounian,

 

The “Do Until” action would be executed only when “When an item is created” trigger is triggered. You change the field to another option means that you update the item in SharePoint list, but the “Do Until” action would not be triggered again, the field value would not be updated and the “Do Until” action would be exeuted every 1 hour.

 

You could consider change the “When an item is cretaed” trigger into “When an item is created or modified” trigger, the “Do Until” action would be executed when the item is created or modified in SharePoint list, but it would arise another flow run. You shoud view another flow run rather than previous one to check if the loop has gotten out of it. 

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: Do until do not working properly

Hi,

 

Your suggestion doesn't work for me, I've tested this but when I change the value, a new flow is created and I can't leave that.

Above is the new flow that I create. When I create a new item, the flow goes to the IF Yes condition because the value is empty and makes a loop, but when I change the value, a new flow starts and goes to IF No because now the field is filled properly but my point is, the old flow still running. The correct flow is the "Do until" field needs to continuous validate the specific field and go out if the condition is false and this thing don't happen

Capture.PNG

 

Dual Super User
Dual Super User

Re: Do until do not working properly

Hi!

Can you click on "Edit in advanced mode" in both the Condition and the Do-Until and share the expression inside?

Thanks!



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Re: Do until do not working properly

@not(equals(empty(triggerBody()?['Capacity_x0020_required']), true))

 

In this case, It's true because the field id empty but when I change the item, the loop still running

Dual Super User
Dual Super User

Re: Do until do not working properly

Is this the expression from the Condition or from the Do Until? Also I was asking for both



Each time you click on any of our inspiring answers 'Thumb up' icon...
...an ewok scapes from the stormtroopers.

Be grateful, Thumbs up! Save the Galaxy for free!


Escribo sobre Power Automate en:
https://medium.com/anyone-can-automate/

Proud to be a Flownaut!



Anonymous
Not applicable

Re: Do until do not working properly

Sorry bro,

 

The Condition: @equals(empty(triggerBody()?['Capacity_x0020_required']), true)

 

Do Until: @not(equals(empty(triggerBody()?['Capacity_x0020_required']), true))

Helpful resources

Announcements
firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors
Users online (5,493)