web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Send email based on co...
Power Automate
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.

 

Categories:
I have the same question (0)
  • mobeenmohsin Profile Picture
    on at

    Hi,

     

    This seems to be data type mismatch issue, please use expression as below:

    https://docs.microsoft.com/en-us/power-automate/use-expressions-in-conditions#use-the-greater-expression

     

    We can parse the value using function in expression as below:

    https://docs.microsoft.com/en-us/power-automate/use-expressions-in-conditions#use-the-greater-expression

     

    Casting has been discussed as below:

    https://powerusers.microsoft.com/t5/General-Power-Automate/Casting-string-to-integer/m-p/38398#M10237

     

    Please mark the answer if solved your problem.

     

    Best Regards,

     

    Mobeen Mohsin

  • efialttes Profile Picture
    14,756 on at
    Hi!
    My suggestion is to use int() based expression on the left side of your condition to transform your forms 'Temperature' output into an integer
    If it stoll does not work, then do the opposite: use int() based expression on the right side of your condition to transform 37.0 into an integer
    Hope this helps
  • XavierMas Profile Picture
    18 on at

    Thanks for your help, but it tells me that my value cannot be converted 🤔

     

    When I enter "@greater(int(triggerBody()?['Temperature']), 37)", it returns:

     

    InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2795': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

  • efialttes Profile Picture
    14,756 on at
    Hi!
    My suggestion is: add a dummy Compose action block just before your Condition, assign is its input:
    triggerBody()?['Temperature']

    reexecute flow. It will fail again, but please inspect and share Compose content.
    Thanx!
  • XavierMas Profile Picture
    18 on at

    There it is 

     

    Capture.PNG

  • XavierMas Profile Picture
    18 on at

    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

    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

  • efialttes Profile Picture
    14,756 on at

    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!

     

  • efialttes Profile Picture
    14,756 on at

    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

     

  • XavierMas Profile Picture
    18 on at

    Thanks for your help 

     

    here's the detail:

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard