How To Increment A Variable With Power Automate

power automate increment variable

A counter or index is often needed when you are iterating over multiple elements. Within Power Automate you can increment a variable in your flow. There is even a dedicated action for incrementing variables within Power Automate. Within this article I will show you in a simple example how to use the increment action step by step.

Step by Step: How To Increment A Variable With Power Automate

  1. Create a new Microsoft flow

    power automate create new flow

    Create new Flow

  2. Add an “Initialize variable” step, name it “counter”, set the type to Integer and the Value to 0

    power automate initalize variable

    Initialize variable

  3. Add a “Do until” step, that will end when the counter variable has the value 3

    power automate do until with counter

    Do until

  4. Add an “Increment variable” step for your variable “counter” like this to the do until loop

    powerautomate increment-variable

    Increment variable Power Automate

You might wonder, why there is Value field. By default the Power Automate Increment variable action increments the variable by 1. Here you can define if you want to increment by another value for instance by 5 (0,5,10,15 …).

Testing the Power Automate flow for incrementing a variable

When you test your flow, you can see how the counter variable increments with every iteration:

powerautomate increment variable test

That’s how you increment a variable in Power Automate!

Leave a Comment

Your email address will not be published. Required fields are marked *