Recently, I had a scenario where I wanted to execute a Logic App action n 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.
Happy learning!
Toon