cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EC_1
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
Paulie78
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
Jcook
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





Paulie78
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
Process Advisor

Introducing Process Advisor

Check out the new Process Advisor community forum board!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (25,500)