cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aakashdmorya
Level: Powered On

Do Until Not working as expected

I am trying to get list items from SharePoint using recursive call via Do Until action. But that seems to not behaving as expected.

Capture.PNG

 

Here the condition is true but still it does not loop again.

 

I tried using Integer variable too. 

 

Any help would be much appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Do Until Not working as expected

@aakashdmorya 

 

You can refer to the below setup for the do until loop:

 

I have two variables temp and testst. Temp is teh one on which i want to implement the do unitl loop and I initialize the value as 0. Testst is the one where I will increment the value in do until and the loop should run until this value is 10 and if it is 10 then i set the value of temp to 1000 that satisfies the do until loop requirement. 

fer1.PNG

Run 1: the value is 0 and is incremented to 5 and is not equal to 10 so the loop will run again.

fer2.PNG

Run 2: incremented variable value is now 10 and the condition is satisfied so we set the value of temp variable to stop the loop.

fer3.PNG

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

8 REPLIES 8
Dual Super User
Dual Super User

Re: Do Until Not working as expected

Hey @aakashdmorya 

 

Can you share more details on the previous steps in the flow? The body that you are iterating the do until loop on, where does it come from? Can you try doing this: Initialize an object variable and in that first get the body and set the value. Later use that variable in the do until loop and then in the loop itself, toward the end, use the set variable action and set the value of this object to the body of the send http request to sp action. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

aakashdmorya
Level: Powered On

Re: Do Until Not working as expected

@yashag2255 

 

If I use following flow

Capture.PNG

 

At the end of the flow the value in the variable "Do Until Counter" is 1 but still it does not loop back.

 

I tried few of the steps mentioned here https://techwizard.cloud/2018/05/20/microsoft-flow-mystery-of-do-until-loop/

 

but still it does not worked.

Dual Super User
Dual Super User

Re: Do Until Not working as expected

Hey @aakashdmorya 

 

Can you also share a screenhot of the flow run? Just to check if the variable set to 1 action was executed?

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Dual Super User
Dual Super User

Re: Do Until Not working as expected

Hey @aakashdmorya 

 

Also, in the initialize the variable step, can you empty the contents of the value field so that it does not have any value (or basiaclly any value other than 0 or 1 as it is being used in the flow later)?

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

aakashdmorya
Level: Powered On

Re: Do Until Not working as expected

@yashag2255 Please find the snapshot that you have asked for,

Capture.PNG

 

Not sure what I am missing,.

Dual Super User
Dual Super User

Re: Do Until Not working as expected

Hey @aakashdmorya 

 

So yes it is working as expected. Here is how: 

 

You have the initialize variable action where you set the value as 1. In the do until you want to run the loop until that value is 1 and then within the loop you have some actions and a condition that sets the value of this variable to either 0 or 1. No in the run history, I can see that the value was set to 1 and so the flow stopped. If you want to reverse it then change the set variable value to 0 in the yes branch and 1 in the no branch. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Dual Super User
Dual Super User

Re: Do Until Not working as expected

@aakashdmorya 

 

You can refer to the below setup for the do until loop:

 

I have two variables temp and testst. Temp is teh one on which i want to implement the do unitl loop and I initialize the value as 0. Testst is the one where I will increment the value in do until and the loop should run until this value is 10 and if it is 10 then i set the value of temp to 1000 that satisfies the do until loop requirement. 

fer1.PNG

Run 1: the value is 0 and is incremented to 5 and is not equal to 10 so the loop will run again.

fer2.PNG

Run 2: incremented variable value is now 10 and the condition is satisfied so we set the value of temp variable to stop the loop.

fer3.PNG

 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

aakashdmorya
Level: Powered On

Re: Do Until Not working as expected

@yashag2255 

 

OH MY GOD..

 

I guess I have to re-take my programming tuitions Smiley LOL.

 

Your example made my confusion clear. Setting the value to 0 while checking the condition worked.

 

Thanks Man....

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Kudoed Authors (Last 30 Days)
Users online (4,757)