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

Community site session details

Session Id :
Power Automate - Building Flows
Unanswered

Using Incrementing a Variable in a Do Until loop

(0) ShareShare
ReportReport
Posted on by 248

Hello. 

I created a list where someone submits a request.  The request would be assigned to employee.  Sometimes there is a need to have more than one employee for the request.    The manager would choose how many employees would be assigned and based on that value, the flow would create copies of that item in that list. 

 

I am trying to create a flow that uses a variable called Count.  If the conditions are met (using a Condition) the Count variable would increment until it match the value "How many will be assigned".  I am using a Do Until flow to accomplish this.  It will not go past 2 items (the original and the new item) even though there the "How many will be assigned" value is 4.  I cannot figure out that I am doing wrong.

 

Capture.PNG

 

Any ideas?  Thank you!!

I have the same question (0)
  • v-bacao-msft Profile Picture
    on at
    Re: Using Incrementing a Variable in a Do Until loop

    Hi @Misa,

     

    Could you please share a full screenshot of the configuration of your flow?

     

    Do you want to create item based on the value of "How many will be assigned"? For example, if the value is 4, create 4 items.

     

    I'm afraid that I couldn't understand the effect of the condition in Do until based on your screenshot.

     

    I  wonder if this condition caused the error, because the Do Until loop already had a condition.

     

    I have made a simple test on my side and don't contain additional conditions in the Do Until loop.

     

    Image reference:

     

    2.PNG

     

    The flow works successfully as below, when the value is 4, 4 items are created:

     

    1.PNG

     

    Please take a try or post more details, we would provide a proper workaround for you.

     

    Best Regards,

    Barry

  • Misa Profile Picture
    248 on at
    Re: Using Incrementing a Variable in a Do Until loop

    Hi Barry and thank you.  You are correct.  The number of items that would be created will be based on the "How many will be assigned" value.  Hopefully the following screenshots help.

      1Capture.PNG2Capture.PNG3Capture.PNG

  • v-bacao-msft Profile Picture
    on at
    Re: Using Incrementing a Variable in a Do Until loop

    Hi @Misa,

     

    Have you tried the method I provided?

     

    Is the issue still exist?

     

    I see the screenshot of the Flow configuration you provided this time, and my method is the same. Did it not worked?

     

    Please feel free reply if you need more help.

     

    Regards,

    Barry

  • Misa Profile Picture
    248 on at
    Re: Using Incrementing a Variable in a Do Until loop

    Hi Barry.  Sorry for the late response.  Using a static number does work but for the purpose of the workflow i would have to use the value of "How many would be assigned".

  • fredyano Profile Picture
    14 on at
    Re: Using Incrementing a Variable in a Do Until loop

    I have similar workflow problem and not sure whether it is a data type issue with Do Until comparison.

     

    Initialize variable

    int(body('Get_file_properties')?['NumberOfApprovers'])

     

    Flow-DoUntil.png

     

    For some reason, the loop will still continue even after I added an Increment variable action and my succeeding steps will fail since I'm using the intCounter variable.

     

    Any type conversions or actions that I should add to finish the loop?  I've also tried adding a Terminate action within the loop but it wasn't allowed. 

     

    Flow-DoUntilFailed.png

     

    Fred

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 650 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 341 Moderator

#3
developerAJ Profile Picture

developerAJ 256

Last 30 days Overall leaderboard