How to write multiple conditions inside If block in Power Automate Desktop

By Debajit Dutta (Former 6x Business Solutions MVP, MCT) / January 11, 2024

Hello everyone and welcome to my blog. This is my first blog of 2024. And wishing all my readers a very happy and prosperous new year.

In today’s blog, I will show how you can include multiple conditions inside If condition in Power Automate desktop.

Let’s start with an example. I have couple of variables Variable1 and Variable2

Variable1 is of type Boolean and Variable2 is of type string. I want to check if Variable1 is true and ‘Variable2 contains the text ‘Hello world’

The If conditional designer in Power Automate desktop resemble below.

If you carefully observe, we can only compare one value at a time. So to check if Variable1 is true and Variable2 contains the text – “Hello world“, then we need to put nested If conditions.

While it may work it may not be the best way to do that. You can actually make it work in a single condition using a simple trick. The below expression evaluate our scenario.

Let’s have a look at the expression in the designer view.

The expression is pretty obvious to understand. I am using the Conditional operators and evaluating the entire expression inside the ‘%’ tag.

And then compare the output of the expression to true or false. That’s good. How do we compare with conditional groupings?

Check for the conditional grouping in the below screenshot.

Here I am checking if Variable1 is true and if Variable2 contains hello world or OneMoreVariable contains powerapps.

A simple and efficient trick I would say. Hope this helped.

About the Author

I am Debajit Dutta and I am currently an architect on Dynamics 365, Power Platform and .NET technologies and specialize in consulting & readiness.

I am also six times Microsoft Most Valuable Professional (MVP) in Business Solutions category and also Microsoft Certified Trainer (MCT) for last five years.

Read more.

References

Dutta, D., (2024), ‘How to write multiple conditions inside If block in Power Automate Desktop’, available at: https://debajmecrm.com/how-to-write-multiple-conditions-inside-if-block-in-power-automate-desktop/ [accessed 27th March 2024].

Share this on...

Rate this Post:

Share: