In this Power Automate tutorial, we will learn How to Initialize Variable Condition using Power Automate with a few examples. And also, we will cover the below-related headings.
- Power Automate initialize variable inside condition
- Power Automate initialize variable after condition
Also, Read: How to Set Variable Based on Condition in Power Automate
Initialize Variable Condition using Power Automate
Let us see how to work with Power Automate initialize variable condition.
Recently, I was working with a requirement where I needed to apply the condition to track the Assigned Task Status. For this purpose, I have used Power Automate and SharePoint List. Follow the below steps to understand it clearly.

To achieve this Follow the below-illustrated steps:
Step:1
- Initially, log in to Power Automate flow using the credentials, and select +Create -> Automated cloud flow.
- Enter the flow name Choose the trigger when an item is created or modified and click on the create option as highlighted below:

Step:2
Configure the trigger with the SharePoint Site Address and List Name here I have selected my SharePoint site and the SharePoint list Name (TaskList).

Step:3
- Select plus sign (+New Step)-> Add an action to initialize variable for the task Status column to track the status of the assigned tasks.
- Enter the variable name as TaskStatus Value and choose the data type as a string and add dynamic content value of Status Value in the value section.

Step:4
- Click on the Next step and select condition control action, to track the status value for the assigned tasks.
- If the Task status is Completed or In-Progress then in the compose action we will display The Assigned task as either in the completed or In-Progress status. Else, if it is blank or On-Hold status then in the compose action we will display The Assigned task in On-Hold status.

Step:5
Select Test-> Manually-> Save & Test to save and test the Power Automate flow.

Step:6
Here we will modify an existing item in the SharePoint list to trigger the Power Automate flow, where the Task Status Value is the In-Progress value as below:

In the below screenshot, we can see that the compose action displays the expected output based on the condition applied.

In the same way, we will modify an existing item in the SharePoint list, where the Task status value contains a blank or empty value.

The Screenshot below displays the result in compose action based on the condition applied.

This is how to Initialize the variable in Condition in Power Automate flow or Microsoft flow.
Check out: How to Work With Set Variable Action in Power Automate [With Examples]
Power Automate initialize variable inside Condition
- No, it is not possible to initialize variable inside the Condition action in Power Automate.
- Because in the Power Automate condition action, we can only see If Yes and If No options. So it is not impossible to initialize variable inside the condition action.
- There is no default option to add an action inside the condition action in Power Automate flow.

Power Automate initialize variable after condition
Let us see how we can initialize the variable after the condition action in Power Automate.
- It is possible to initialize variable after the condition action, but it is not possible to use the initialized variable in the Previous step. If we use it, then the error occurs.
- If we want to use the initialized variable in the condition action, then we have to initialize it before the condition action step.
Here you can see I have initialized the variable after the condition action step:

- To save and test the Power Automate flow Select Test-> Manually-> Save & Test.
- In the below screenshot, you can see the flow run has failed because of the wrongly initialized variable.

So it is impossible to initialize variable after the condition action and use the initialized variable in the prior step in the Power Automate flow.
In this Power Automate tutorial, we have learned How to Initialize Variable Condition using Power Automate with a few examples. with examples. And also we covered the below-related headings.
- Power Automate initialize variable inside condition
- Power Automate initialize variable after condition
Additionally, you may like some more Power Automate tutorials:
- How to Get Current Date in Power Automate
- How to Use Power Automate Delay Action
- Conditionally Update SharePoint list items using 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…