Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Why the condition is false for the same numbers (Power Automate)

Posted on January 25, 2023January 25, 2023 by Tom

“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.

Power Automate condition false numbers

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 >.

Power Automate condition false numbers

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(…).


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with 1000s of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes