Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Triggers
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Resources
  • Get help with 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!


NEW! Master the HTTP requests to SharePoint with a new cheat sheet!

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.

Hello and welcome!

My name is Tom and I'm a business process automation consultant and Microsoft MVP living in the Czech Republic. I’ve been working with Microsoft technologies for almost 10 years, currently using mainly Power Automate, SharePoint, Teams, and the other M365 tools.

I believe that everyone can automate part of their work with the Power Automate platform. You can achieve a lot by "clicking" the flows in the designer, but you can achieve much more if you add a bit of coding knowledge. And that's what this blog is about.

To make the step from no-code Power Automate flows to low-code flows: using basic coding knowledge to build more complex yet more efficient flows to automate more of your daily tasks.

  • Use Power Automate to forward Outlook events upon registrationJanuary 29, 2023
  • Why the condition is false for the same numbers (Power Automate)January 25, 2023
  • How to forward event invitation to other calendar (Power Automate)January 22, 2023
  • Run ‘For selected item’ flow from non-default environment (Power Automate)January 18, 2023
  • Hide button in SharePoint list after Power Automate flow startedJanuary 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes