if function(Power Automate Cloud flows)

Japanese version.

This function changes the value returned depending on whether the result of the expression is True or False.

It works similar to the IF function in Excel.

When multiple actions are to be executed depending on the result of the judgment, or when the actions to be executed are different, "Condition" is used, but if the actions are only different numbers or text, the if function is more appropriate in many cases because it is more concise.


if(<expression>, <valueIfTrue>, <valueIfFalse>)
expressionRequired fieldBoolean variable or function to be judged.
(whose result is true or false)
valueIfTrueRequired fieldResult when expression is true.
Can be text or numeric.
valueIfFalseRequired fieldResult when expression is false.
Can be text or numeric.

How to use

In most cases, it is used in the "Value" of a "Initialize Variable" or "Set Variable" action.

The "Type" depends on the "valueIfTrue" or "valueIfFalse".

Click on the "Expressions" tab, if, and the function name and () will be set in the formula field.

Set the arguments in it.

  • The first argument: logical expression or function.
  • Second argument: If the result of the first argument is True.
  • Third argument: the result of the first argument if the result is False.

If the second and third results are text, enclose them in '.

If dynamic content or variables are used as arguments, special specifications are used.
(How to get dynamic content with an expression)

This sample is simple, but in many cases it is used in complex logical expressions combined with other logical functions.

Click on the OK button and the following display should appear.

You can change the function by clicking on the purple icon.

For example, if you incorporate it into an action to send an email,
The result of the condition can be used to switch the destination, subject, body, and so on.



Logical Functions