How to Use If-Else in Power Automate Microsoft Flow?

Use If Else conditional statements to handle the decision based on the condition defined. We will see them in action in Power Automate Microsoft Flow.

Create a new flow. I am creating a Manual Flow for this demo.

I will be creating a very simple flow having an if condition of checking if my number is greater than equal to 18. To start with, initialize a variable with name number of type integer and default value 6.

Initialize a variable of type Integer in Power Automate MS Flow

Add a new Step Condition. On the left side, add the variable number from the Dynamic Content. Choose the condition greater than or equal to. On the right side, give the value 18.

Using If-Else condition in Power Automate Microsoft Flow (MS Flow)

I will just add Compose Step in both the places (If and Else) with different values. This is just for the understanding purpose.

If-Else condition having Compose Step

Save the flow and run it manually. We will see both the test cases.

Negative Test (number = 6)

The condition (6 >= 18) becomes false. The flow goes to If No. The compose output shows the value (6 < 18).

Negative test case 6 >= 18 for If-Else Condition in Power Automate Microsoft Flow (MS Flow)

Positive Test (number = 19)

The condition (19 >= 18) becomes true. The flow goes to If Yes. The compose output shows the value (19 >= 18).

Positive test case 19 >= 18 for If-Else Condition in Power Automate Microsoft Flow (MS Flow)

Take a course from ExamLabs on AWS Certified Solutions Architect – Professional: AWS Certified Solutions Architect – Professional (SAP-C01).

Thank you All!!! Hope you find this useful.


Leave a Reply

Up ↑

%d