All about how to use comparison operators in Power Automate

Hello everyone and welcome to my blog. In today’s blog, we shall learn about the comparison operators in Power Automate and how to use them in expressions. We will discuss on the following comparison operators.

  1. Equals comparison
  2. Greater than comparison
  3. Less than comparison
  4. Less than or Equals comparison
  5. Greater than or Equals comparison

I keep frequently getting requests from a lot of users starting with Power Automate to write content for beginners. I am planning to write a blog series for the same and this is the first blog of the series.

If you have already worked with Power Automate for sometime you should already be aware of the concepts discussed in this blog. However I won’t mind if you continue reading 🙂

Through my blog I share interesting tips and discuss on latest releases of Microsoft.NET technologies, Dynamics 365 and Power Platform, SharePoint and Client scripting libraries. Please subscribe to my blog to stay updated.

Business Users and even developers with different technology background starting with Power Automate get stuck with simple comparisons. This is because when we discuss comparisons, most of us are accustomed to use =, <, >, <=, >=.

However comparisons does not work similarly in Power Automate. This is because Power automate expressions are essentially functions. Below are the examples on how to use these comparison operators.

Equals

Power Automate have equals() function. Below illustration show the usage of equals function. I am checking if a variable value is equal to 10 or not.

You can compare other data types accordingly.

But what about objects? How to compare objects in Power Automate? Well, the equals function does that job too.

For example – I have couple of variables of type JSON object. Below illustration show the variable declaration and their content.

The next step is to use the equals function to compare them. Below is the illustration of comparison in action.

Expectedly, the outcome of the operation is true. Now that you have understood the equals function, the other functions are relatively easy.

Less than/ Less than or Equals

Below is an illustration of Less than and Less than equals.

In the below illustration, we are checking if a variable X is less than or equal to 20.

We similarly have the less() function.

Greater than/ Greater than equals

Similarly we have the greater() function.

Hope this helped. For similar interesting topics on Microsoft.NET and Power platform, you can subscribe to my blog.

Debajit Dutta
Business Solutions MVP