web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Do Until Not working a...
Power Automate
Answered

Do Until Not working as expected

(0) ShareShare
ReportReport
Posted on by 25

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.

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    25 on at

    @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.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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 Profile Picture
    25 on at

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

    Capture.PNG

     

    Not sure what I am missing,.

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    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!

  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    @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!

  • aakashdmorya Profile Picture
    25 on at

    @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....

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 288 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 125

Last 30 days Overall leaderboard