cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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
Paulie78
Super User
Super User

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
Jcook
MVP

Hello @Anonymous 

 

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





Paulie78
Super User
Super User

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 😙

  

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,350)