if function(Power Automate Cloud flows)
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.
Spec
if(<expression>, <valueIfTrue>, <valueIfFalse>)
Argument | Default | Description |
---|---|---|
expression | Required field | Boolean variable or function to be judged. (whose result is true or false) |
valueIfTrue | Required field | Result when expression is true. Can be text or numeric. |
valueIfFalse | Required field | Result 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.
For those who want to learn Power Automate Cloud flow 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 Cloud flow to streamline your workflow.
Discussion
New Comments
No comments yet. Be the first one!