Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - General Discussion
Answered

Coalesce function not working within Condition Control Action

(1) ShareShare
ReportReport
Posted on by 17
Hi All,
 
We have a Flow that requires to check if a Whole Number field is greater than or equal to 0 but it fails with the subject error as its returning a Null value if no numeric value has been set for the field. Looking into this I thought I can simply use the coalesce function which works and returns a 0 within my Compose Action but when the Compose Action is used within Condition Control Action I see get the same error even though the value is set to 0 by the Coalesce Formula. Does anyone know why this is happening and how to fix it?

Error: The template language function 'lessOrEquals' expects all of its parameters to be either integer or decimal numbers. Found invalid parameter types: 'Null'
 
Formula: coalesce(outputs('Get_Company')?['body/byt_totalusers'],int(0))
 
Categories:
  • David_MA Profile Picture
    11,387 Super User 2025 Season 1 on at
    Coalesce function not working within Condition Control Action
    According to the error message, the coalesce function is returning null. Based on the conversation, I am not sure if you updated you coalesce statement. If you haven't update it to one of these two expressions:
    1. coalesce(outputs('Get_Company')?['body/byt_totalusers'],int('0'))
    2. coalesce(outputs('Get_Company')?['body/byt_totalusers'],0)
    If you don't understand the difference from what you have:
    1. Putting the single quotes around 0 makes it a string. The int() expression is used to convert a string to an integer.
    2. Just using 0 requires no conversion since 0 is already an integer.
    I am pretty sure either should work but don't have the time to test them right now.
  • Verified answer
    Adam_Travers Profile Picture
    17 on at
    Coalesce function not working within Condition Control Action
    Hi, I have managed to fix this so many thanks for your help.
  • Adam_Travers Profile Picture
    17 on at
    Coalesce function not working within Condition Control Action
    Hi,
     
    Many thanks for the response. I still get the error if I change it to the below, however, if I just have a single condition using my Compose field it works.

  • Verified answer
    CA1105 Profile Picture
    499 on at
    Coalesce function not working within Condition Control Action
     
    I guess you are looking at the wrong parameters since error is saying expression is wrong for "LessOrEquals". Check value for below condition.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >