“I have two numbers, they’re the same, yet the condition in Power Automate evaluates as ‘false’ when comparing them!”
Comparing two numbers is such a common functionality in many Power Automate flows. You have two numbers and depending on their comparison the flow will do something. It can be a backup column to avoid infinite trigger loop via trigger condition, a rating from Forms, or just any two numbers. Yet even if the numbers look the same in the flow, when used in a ‘Condition’ it always returns ‘false’! Why? Why does it tell you that it’s not the same number even though you can see it is?
The same character, different format
If the ‘Condition’ doesn’t work you encountered a problem with different data types. There’s a difference whether the number is a number or a “text” that contains the number character. If they’re not the same type the ‘Condition’ can be evaluated as ‘false’.
To get the desired result you must convert both the values to the same type. There’re two expressions to convert a ‘number’ into a number.
Use int(…) to convert whole numbers
The first one is int(…) that’ll convert a numeric value into an integer.
int(<number>)
Note: <…> is a placeholder, replace it including the < and >.
But it must be a whole number with no decimal places. Once you try to convert a decimal number into integer the action will fail.
As such the int(…) expression is a good solution only when you’re 100% sure that the number won’t have any decimal places, e.g. when working with a date.
Use float(…) to convert decimal numbers
If your number can contain also decimal places, use the float(…) expression. This expression is more generic as it doesn’t care about the number format. If it’s a whole number – fine; if it’s a decimal number – also fine.
float(<number>)
Note: <…> is a placeholder, replace it including the < and >.
Once you have the numbers in the same format it should evaluate the conditions correctly.
Summary
When your Power Automate condition always returns ‘false’, even though you can see that the numbers are the same, try to play with the data type. There’s a chance that one of the numbers is a text, not a number, and Power Automate doesn’t like that. Take both sides of the condition and convert them into the same data type. If they’re whole numbers, you can use the int(…) expression, but once decimal numbers come into play you’ll have to use float(…).