For loop in Logic Apps

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

2 thoughts on “For loop in Logic Apps

  1. Pingback: January 20, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS | Hooking Stuffs Together

  2. Pingback: January 20, 2020 Weekly Update on Microsoft Integration Platform & Azure iPaaS - BizTalkGurus

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s