Recently, I had a scenario where I wanted to execute a Logic App action times.  I wanted to achieve the equivalent of the following C# snippet:

for (int i = 0; i < 100; i++)
{
    //Perform action
}

Some research on the internet tells me that most folks solve this by using a Do-Until action, combined with Initialize Variable and Increment Variable.  Although this works fine, it requires quite some plumbing.  I thought: “there has to be an easier way” and yes… there is an easier way!

In order to loop 100 times, you can just use the foreach action and loop based on the following expression: range(1, 100).  The range function is explained over here.

For loop

Happy learning!
Toon

ABOUT

MEET THE YOUR AZURE COACH TEAM

Your Azure Coach is specialized in organizing Azure trainings that are infused with real-life experience. All our coaches are active consultants, who are very passionate and who love to share their Azure expertise with you.