If variable = 6 then do activity 6 times. etc etc, How to get this to work?

Hey, I have a small question
How can I make the following sequence:
If variable = 0 then do activity 0 times
If variable = 10 then do activity 10 times
If variable = 100 then do activity 100 times

Can I do this with the for each function maybe? Help would be appriciated!

Hi @Peter_Peter

You can use While activity here.

  1. Assign intCounter = 1
  2. While intCounter <= variable
    1.1 Insert your activity here.
    1.2 Assign intCounter = intCounter + 1

Alright thanks, I think this will work well!

Cool! Good to hear that :slight_smile:


You can do this without using an external counter by using a For Each with Enumerable.Range.
You would just need to replace ‘100’ with whatever your variable is.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.