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

How to exclude email by domain in Auto-reply flow?

Oeskandarian_0-1636998777604.png

Hi Everyone,

I have created a simple flow, and it does the following.
An email comes to a SharedMailbox (number1) from a specific email address (number 2) in the condition section; it grabs the CC and replies back to the CC with a message.
Is there a way to filter out/exclude certain domains so that the flow won't reply to everyone cc in the email? For example, if the sender included the @gmail.com email, I exclude that domain from the rest. I want to do it because the sender will cc other people in our company, but I don't want the flow to reply to everyone.

 

1 ACCEPTED SOLUTION

Accepted Solutions
mahoneypat
Solution Sage
Solution Sage

To do that, you need split the Cc from the email at the ; and then Filter that array for those do not contain the domain to exclude.  You can then use the join function with a ';' delimiter to get the new string to use in the reply email.

 

mahoneypat_1-1637068016232.png

 

join(body('Filter_array'), ';')
 
split(triggerOutputs()?['body/ccRecipients'], ';')

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
mahoneypat
Solution Sage
Solution Sage

To do that, you need split the Cc from the email at the ; and then Filter that array for those do not contain the domain to exclude.  You can then use the join function with a ';' delimiter to get the new string to use in the reply email.

 

mahoneypat_1-1637068016232.png

 

join(body('Filter_array'), ';')
 
split(triggerOutputs()?['body/ccRecipients'], ';')

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about the Power Platform, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


ChrisMendoza
Resolver IV
Resolver IV

@Oeskandarian- I wonder if using a Trigger Condition logic would work using https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#e... instead of what I use in my example:

image.png

Oeskandarian
Frequent Visitor

Hi Mahoneypat,

Thank you for the reply; It is working. I added Condition and made Outputs is equal to Outputs, then added the Send an email (v2). I said three domains ( Gmail, Hotmail & my work domain). The reply went to everyone except Gmail. Here are my screenshots.

 

Picture3.jpgPicture4.jpg

 

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.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

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.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (5,216)