cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aaronc63
Frequent Visitor

Evaluating Email Inputs (Expression or Variable?)

Hello.  First-time poster and a relatively new Power Automate user.  I am hoping someone can help guide me in the right direction on the best way to tackle an issue I'm facing.

 

I built a Power App that tracks requests for assistance for our team.  When a request is submitted, it is patched to a SharePoint list.  There are two Person fields, Requester and Requested For.  They will often be the same value, unless the Requester is submitting the request for someone else.  I have created a Power Automate flow to generate an email when a new request is submitted.  It is sent to the Assignee and the Requester/Requested For are copied.

 

Ideally, Power Automate would check to see if the Requester and Requested For are the same, and add one instance of the email address to the cc: line, or both if they are different.

 

I've tried building the following expression to tackle this, but I am new to expressions and it doesn't seem to work.

 

If (
   equals(triggerOutputs()?['body/Requester/Email'],triggerOutputs()?['body/Requested_for/Email']),
   triggerOutputs()?['body/Requester/Email'],
   concat(triggerOutputs()?['body/Requester/Email'],";",triggerOutputs()?['body/Requested_for/Email'])
)
 
Is there a better way?  Should I create a variable to capture this information or do I just need to tweak my expression?
 
Any guidance is greatly appreciated.  Thank you!
1 ACCEPTED SOLUTION

Accepted Solutions
Mister_Shaik
Solution Sage
Solution Sage

Hi @aaronc63 ,

 

Your expression logic is correct, but in power automate double quotes are not allowed. For the semicolon, enclose it in single quotes rather than double quotes and it should work.

 

Hope you find this helpful! 🙂

 

Kind Regards,

Shaik Sha

________________________________________________________________________

If I have answered your question, please mark the post as Solved.

If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Mister_Shaik
Solution Sage
Solution Sage

Hi @aaronc63 ,

 

Your expression logic is correct, but in power automate double quotes are not allowed. For the semicolon, enclose it in single quotes rather than double quotes and it should work.

 

Hope you find this helpful! 🙂

 

Kind Regards,

Shaik Sha

________________________________________________________________________

If I have answered your question, please mark the post as Solved.

If you like my response, please give it a Thumbs Up.

aaronc63
Frequent Visitor

Hi @Mister_Shaik ,

 

I am so embarrassed that I didn't catch that, but this is what I get when I'm moving too fast.  This solved the problem, so thank you!  Am I using the best approach to tackling this issue?

Mister_Shaik
Solution Sage
Solution Sage

@aaronc63  Yes, for this case scenario, I see this as a better solution than having variables and condition actions to check and store the email data - you simplified things by using expressions 👍

Thank you, so very much, sir!  I am just starting this journey with Power Automate, so I wasn't sure if there was a more efficient way to handle this issue.  I am so thankful for the guidance.  Have a wonderful rest of your day!

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Users online (1,202)