Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Send email based on condition from Forms result

(0) ShareShare
ReportReport
Posted on by 18

Capture.PNGHi

 

Based on a submitted reply from Forms, I'd like an email to be automatically sent if the result is greater than a constant. 

 

I've followed the steps from other posts but I am still getting this error message " Unable to process template language expressions for action 'Condition' at line '1' and column '2794': 'The template language function 'greater' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'".

 

Thanks for your help.

 

  • efialttes Profile Picture
    14,756 on at
    Re: Send email based on condition from Forms result

    Hi!

    First of all, my apologies since I first suggested to use int()

    Now, in my example flow I added too much action blocks just to make it easier. Some of them (compose, initialize variable) can be skipped so you just need to use an expression in your left side of your condition:

    float(replace(body('Get_response_details')?['r1438671f27124a2fa113f003c49691f2'],',','.'))

     

    In my example the reason to use a Compose+Initialize variable (two extra steps) was to avoid typing so many characters... I would have probably added some typos if not 😄

     

    Flow_Temperature_2.png

    Hope it helps

  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    Thank you so much for the speedy replies, it works like a charm! Crazy that we have to go through all these steps for something that sounds simple to achieve... Do you know why?

  • Verified answer
    efialttes Profile Picture
    14,756 on at
    Re: Send email based on condition from Forms result

    Working!

    Flow_Temperature.png

    As you see, it is working for both 5.6 and 40.5.

    The expression I am using to Initialize variable is:

    float(replace(outputs('Compose_Temperature'),',','.'))

    In the expression I am also replacing comma and adding dot instead, to make sure dot is used as float separator

    Hope this helps

  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    adding float is not working so much:

     

    greaterOrEquals(float(outputs('Compose')),'37')
     
    returns :
    InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2794': 'The template language function 'greaterOrEquals' expects two parameter of matching types. The function was invoked with values of type 'Float' and 'String' that do not match.'.
  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    Thanks for your help 

     

    here's the detail:

    Capture 2.PNG

  • efialttes Profile Picture
    14,756 on at
    Re: Send email based on condition from Forms result

    Hi again

    It is my fault, I suggested to use int() but we need to use float() instead.

    More info un a couple of minutes

     

  • efialttes Profile Picture
    14,756 on at
    Re: Send email based on condition from Forms result

    Hi!


    @XavierMas wrote:

    I am making more progress, the flow is running now when using "Outputs" from compose.

     

    However the logical test (greater than 37) is acting weird, it returns the following:

     

    "2" it returns false,

    "36.7" it returns false

    "37.1" it returns true

     

    but

     

    "4" or "5"... etc until "9", it returns true as if the logical test was only on the first number


    THe current problem is... Compose seems to have transformed your form input into a string, so your condition is now comparing two strings... Integer 4 is lower than 37, but string '4' is greater than string '37'.

     

    On your flow design, can you please hover the mouse over the dynamic content you currently have assigned as input to Compose and send me the screenshot with its value?

    Thanx!

     

  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    I am making more progress, the flow is running now when using "Outputs" from compose.

     

    However the logical test (greater than 37) is acting weird, it returns the following:

     

    "2" it returns false,

    "36.7" it returns false

    "37.1" it returns true

     

    but

     

    "4" or "5"... etc until "9", it returns true as if the logical test was only on the first number

  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    I am not sure I did that right...

     

    If I select "Temperature" in compose as below

     

    Capture 2.PNG

     

    I am getting the following result:

    Capture.PNG

  • XavierMas Profile Picture
    18 on at
    Re: Send email based on condition from Forms result

    There it is 

     

    Capture.PNG

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June 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 > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1