cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

Add a Condition to email body

How can i add a condition base on the inputs/values that the flow get from PowerApps

I have a form that register the parameters of a machine
if this parameters are out of range it will send and alert/email to notify that something is wrong

I already solve the alert base on a condition but now i need to specify which parameter is out of range

EC_1_0-1603900319416.png

If VLP is less than 16 or grater than 33 I need a text next to it indicating that is "Out of Range" if not the text will be blank
and so on with the others parameters 
is this possible?

I made a test on my own but i got and error

If(and(less(triggerBody()['Sendanemail(V2)_Body_2'],16),greaterOrEquals(triggerBody()['Sendanemail(V2)_Body_2'],33)),"Out of Range","")






1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

Try something like this:

if(
  or(
    less(int(triggerBody()['Sendanemail(V2)_Body_2']),16),
    greater(int(triggerBody()['Sendanemail(V2)_Body_2']),33)
	),'Out of Range','Within Range')

You had an "and" condition in your expression. A number cannot be both less than 16 and greater than 33 at the same time, but it can be either one.

For the purposes of testing I changed it to show Out of Range or Within Range but you can easily adjust it.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

  

View solution in original post

2 REPLIES 2
Super User III
Super User III

Hello @EC_1 

 

What is the error you received?

 

Change your double quotes to single quotes.

If(and(less(triggerBody()['Sendanemail(V2)_Body_2'],16),greaterOrEquals(triggerBody()['Sendanemail(V2)_Body_2'],33)),'Out of Range','')

 





Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips, tricks, and guides
FlowAltDelete




Super User III
Super User III

Try something like this:

if(
  or(
    less(int(triggerBody()['Sendanemail(V2)_Body_2']),16),
    greater(int(triggerBody()['Sendanemail(V2)_Body_2']),33)
	),'Out of Range','Within Range')

You had an "and" condition in your expression. A number cannot be both less than 16 and greater than 33 at the same time, but it can be either one.

For the purposes of testing I changed it to show Out of Range or Within Range but you can easily adjust it.

 

Please...

If I answered your question Accept it as a solution ✔️ 

If I helped you out, please give me some Kudos 👍

Thanks 😙

  

View solution in original post

Helpful resources

Announcements
Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (47,931)