web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerAutomate Conditio...
Power Automate
Answered

PowerAutomate Condition in outlook where "To" should be from a person from a domain but not anyone else in the same domain

(0) ShareShare
ReportReport
Posted on by

I am creating an alert flow in PowerAutomate where I wanted to add a condition where if "To" contains XYZ@domain.com but there is nothing else from @domain.com, then the flow would trigger an alert. If there are other email IDs in the "To" section which is not from @domain.com, The flow should still be triggered. I have pasted a screenshot of what I have so far but it does not seem to work.

 

Balajied1999_0-1638254885907.png

 

Categories:
  • Verified answer
    efialttes Profile Picture
    14,756 on at

    @Balajied1999 
    What a challenging issue!
    I am assuming your Flow is triggered by means of 'When a new email arrives'
    If so, I would rather transform and merge To and CC into a single array by means of union() and split() functions, use 'Filter array' to remove XYZ@domain.com; then convert back Filter array output into a string by means of join()

    efialttes_0-1638260571878.png

    I am using the following expression in 'Initialize variable'...

     

    union(split(triggerOutputs()?['body/toRecipients'],';'),split(triggerOutputs()?['body/ccRecipients'],';'))

     

    ...also the following expression as left term of 'Filter array'...

     

    item()

     

    ...and finally the following expression as the left term on 'Condition':

     

    join(body('Filter_array'),';')

     

    Hope this helps




    Hope this helps

  • CU26090710-0 Profile Picture
    on at

    Yes Close. What I want is that when a new email arrives in a shared mailbox (XYZ@domain.com), most people outside the organization copy someone or the other from the organization along with the mailbox email ID. There are rare cases where clients send the email to only the Shared mailbox's email ID and these emails go unnoticed. So what I wanted was that if we get an email where a client only sends the email to the shared mailbox with no one else from @domain.com, Admin gets the notifications.

  • Verified answer
    efialttes Profile Picture
    14,756 on at

    Hi again!
    Well, it seems my proposal matches your requirements, right? Or am I missing something?
    Please give it a try and let us know your progress
    Thanx!

  • CU26090710-0 Profile Picture
    on at

    That really helped me Thanks!

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 430

#2
11manish Profile Picture

11manish 341 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 282

Last 30 days Overall leaderboard