Conditional Branch.If and Switch.(Power Automate Desktop)


Japanese version.

This section introduces conditional branching, which switches the action to be executed depending on the situation.

Use of If and Switch

At a minimum, using only If is fine, since If can be used for any situation.
Switch is more appropriate than If when there are two or more branching conditions for a single variable.

Therefore, use If basically, and then use Switch depending on the situation.

How to use



Drag If from Conditionals onto the Workspace.

The "first operand" and "second operand" specify what is to be compared, and the operator specifies the comparison method.

Click {x} to specify variables.

The most common form is to specify a variable for the "first operand" and a fixed value or variable for the "second operand".

In the condition below, when the variable num_1 is 10, the result is True.

Between If and End, place the action you want to take if the result of the condition is True.

In the following example, Display message is executed only when the variable num_1 is 10.

Else if

Else if is an action to add a condition; drag it into the If.

In the following example, if the variable num_1 is 10 or more, the action in the IF is executed; if it is 5 to 9, the action in the Else if is executed.

Conditions are judged from the top.
If multiple conditions apply, only the action in the first applicable condition is executed.


Else is an action to set the behavior if none of the conditions are met.

It can only be placed at the end of an If.

In the flow below, if the variable num_1 is 10 or more, the action in If is executed; if it is 5 to 9, the action in Else if is executed; if it is 4 or less, the action in Else is executed.

Switch.Switch and Case and Default case

Drag Switch from Conditionals onto the Workspace.

Specify variables in Values to Check.
Click {x} to select a variable that has already been created.

Drag the Case into the Switch.

In the flow below, the action to be performed changes depending on the button pressed for Display message.
There must be at least one Case in Switch.

Default Case specifies the action to be taken when no Case is matched.

It is used by dragging it to the end of Swicth.Default case may be omitted.

Formulas and Operators.How to specify multiple condition designations.

To specify conditions with mathematical expressions, use the following operators.This allows multiple conditions to be specified.

OperatorConditions to be True
A = BA and B are equal.
A != BA and B are not equal
A < BA is smaller than B
A <= BA is less than B
A > BA is greater than B
A >= BA is more than B
A OR BEither A or B is True
A AND BBoth A and B are True

OR and AND are evaluated at a lower priority, but can be enclosed in parentheses to increase the priority.

Although formulas can be used in both If and Switchchn, Switch is not suitable for complex formulas, so it is recommended to use them only in If.

For example, if the variable num_a and the variable num_b are both greater than or equal to 3, the condition is as follows.

First operand%num_a >= 3 AND num_b >= 3%
OperatorEqual to (=)
Second operand%True%

For those who want to learn Power Automate Desktop effectively

The information on this site is now available in an easy-to-read e-book format.

Or Kindle Unlimited (unlimited reading).

You willl discover how to about basic operations.

By the end of this book, you will be equipped with the knowledge you need to use Power Automate Desktop to streamline your workflow.


Introduction(Power Automate Desktop)


How to set IF conditions in Or and And.

Examples of Use

Obtain the number, total, average, maximum, and minimum of the numbers in the list.

Delete rows of Excel with specific conditions.

Example of simple web browser auto-operation: auto-filling a web form.

Specify date range to retrieve mail.

How to remove text, from the left or right, by specifying the number of characters.

How to leave text with a specified number of characters from the left or right.

How to extract characters before, after, or between specific text.

How to get the earlier or later date.Date and time comparison.

How to judge even/odd numbers.

How to get absolute values.