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

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

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

@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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

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

Users online (3,066)