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

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
Community Support Team
Community Support Team

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.
Misa
Level: Powered On

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

Community Support Team
Community Support Team

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.
Misa
Level: Powered On

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
Level: Powered On

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

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 85 members 4,142 guests
Please welcome our newest community members: