cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate V
Advocate V

Using Incrementing a Variable in a Do Until loop

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

5 REPLIES 5
Highlighted
Community Support
Community Support

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

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate V
Advocate V

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

Highlighted
Community Support
Community Support

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

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate V
Advocate V

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

Highlighted
Frequent Visitor

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

 

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (11,003)