Skip to main content

Notifications

Power Automate - General Discussion
Answered

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

(0) ShareShare
ReportReport
Posted on by 12

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.

 

  • Oeskandarian Profile Picture
    Oeskandarian 12 on at
    Re: How to exclude email by domain in Auto-reply flow?

    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

     

  • ChrisMendoza Profile Picture
    ChrisMendoza 425 on at
    Re: How to exclude email by domain in Auto-reply flow?

    @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#endswith instead of what I use in my example:

    image.png

  • Verified answer
    mahoneypat Profile Picture
    mahoneypat 1,720 on at
    Re: How to exclude email by domain in Auto-reply flow?

    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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard