This Power Automate tutorial explains, how to initialize integer variable in Power Automate with an example.
Also, Read: How to Initialize Object Variable in Power Automate
Initialize Integer Variable in Power Automate
- In Power Automate flow One of the variable datatypes is an Integer data type. When we initialize a variable with an integer variable type it accepts the Whole number value that can be positive, negative, or zero.
- When we initialize a variable with integer type, it accepts only the Single Parameter in the value section. It will not accept multiple values.
In the following example, we will see how to initialize a variable Integer in Power Automate flow.
Let us see how we can initialize a variable Integer in the Power Automate flow.
Example-1:
In this example, we will use two integer values as input values to calculate the previous month and current month sales values, and add then we will initialize a variable to add the previous month’s and current month’s sales values.
Create an instant cloud flow, and select the trigger as manually trigger a flow and click on the create option.

- Expand the Manually trigger flow, and choose the type of user input by selecting +Add an input and select the Number variable type.

- Now add the +new step and select the initialized variable to enter the variable name and choose the variable type as Integer and in the value section pass the dynamic value.
- Here in this example, I have added a Current Month’s sales value. In the same way, initialize another variable to get the Previous Month’s Salesvalue as below:

Now we will add the compose action, to add the two sale values using add function from the initialized variable to get output.
add(variables('VarInt1'),variables('VarInt2'))
Where,
- add -> Function name
- VarInt1,VarInt2 -> Initialized Variables names

- Save and Test the Power Automate flow and then Run the flow automatically.
- In the below screenshot, in the compose action you can see it displays the addition of current month sales value and the previous month sales value as highlighted below:

This is how to initialize the variable Integer in Power Automate flow.
Example:2
In the same way, in this example, we will how to subtract the values of the initialized variable with the type of Integer in Power Automate flow.
- Select the created Power Automate instant cloud flow, expand the trigger action and select Add an input ->, and then choose the input type as a Number.
- Enter the Name and pass the numeric value in the value section as highlighted below:

- Now add the +new step and select the initialize variable, then enter the variable name and choose the variable type as Integer and in the value section pass the dynamic value for Generator age.
- In the same manner, add the dynamic value for Generator Warranty Period with the variable type as Integer.

- Select the compose action to calculate the remaining generator warranty period in years, enter the below expression click update or ok option.
sub(variables('Generator Warranty Period'),variables('Generator Age'))
Where,
- sub -> Function name
- Generator Warranty Period,Generator Age -> Initialized Variables names

- In the below screenshot, we can see that the compose action displays the remaining generator warranty period as below:

This is another example to initialize an integer variable in Power Automate flow.
In this Power Automate Tutorial, we have discussed what is Initialize Variable Integer and how to initialize integer variable in Power Automate with a few examples.
You may like the following Power Automate tutorials:
- How to Check If a Date is Blank in Power Automate?
- How to Initialize Float Variable in Power Automate
Bijay Kumar Sahoo is a highly accomplished professional with over 15 years of experience in the field of SharePoint and related technologies. He has been recognized as a Microsoft MVP (Most Valuable Professional) more than 9 times, starting from April 2014, for his exceptional contributions to the SharePoint community. Bijay is also a prolific author, having written two books on SharePoint – “Microsoft Power Platform – A Deep Dive” and “SharePoint Online Modern Experience Practical Guide“. His deep insights into SharePoint are also shared on his popular YouTube channel EnjoySharePoint where he teaches SharePoint to a global audience (From various countries like the United States of America, Canada, the United Kingdom, Australia, New Zealand, etc). Read more…