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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Outlook email rule bas...
Power Automate
Answered

Outlook email rule based on sender's partial display name

(0) ShareShare
ReportReport
Posted on by 11

In the legacy Outlook, it was possible to create a rule that looked for a partial display name from the sender's details and moved the email to a specified folder.

 

In the new Outlook, the same feature does not seem to be working. The following rule does not work.

"If the sender's address contains these words: 'client_tester_xyz
(work review) [******@xyz.com]' or 'client_tester_xyz', move the message
to folder 'My Folder' and stop processing more rules on this message."

 

I posted this question on Microsoft Learning Forum - https://learn.microsoft.com/en-us/answers/questions/5492048/creating-a-rule-based-on-part-of-senders-display-n?page=1#answer-12130496 and I was suggested to ask on this platform for advanced customization.

 

Categories:
I have the same question (0)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Here is a minimal flow you can try:
     
    1. Logon https://make.powerautomate.com, choose the correct environment from the top right of the window.
     
    2. Click +Create , Choose Automated cloud flow
     
    3. Give it a name, Choose  your  flow's trigger, 
        search When a new email arrives (V3) if you use office365, When a new email arrives (V2) if you use outlook.com
     
    4.  Choose Advanced parameters accordingly.
     
    5. Click +, then search Condition, and choose it.
        Choose the first box, and click fx, then type formula 
    toLower(triggerOutputs()?['body/from'])
    choose contains in the dropdown list.
     
    The right one, type client_tester_xyz
     
    6. Inside true. click +. Add Move email(v2). if you use outlook, choose Move email.
     
    Message id: ( type or copy below)
    @triggerOutputs()?['body/id']
     
    Folder : choose your own folder.
     
    that's it.
     
     
  • CU24071757-2 Profile Picture
    11 on at
    Thanks, @stampcoin, for your response.
    I created the flow but I am still seeing the emails in my "Inbox" and not in other folder where I want them to be redirected. What could be missing in my setup and how can I debug it?
     
     
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Please check the running history, then pick one and review the output of trigger body.
    check the email address if matches the defined condition.
    In my previous example, sender's email address much contain client_tester_xyz.
    if you get condition evaluated = true, then something wrong with the move email step.
    but check the above I mentioned please.
  • CU24071757-2 Profile Picture
    11 on at
    Thanks @stampcoin for your response.
    I checked it and it looks like my flow is checking for the content is "body/from" that only contains email address, but I want it to check for display name of the sender. E.g., Peter Parker <peter12345ATxyz.com>, here I want my flow to check for "Peter Parker" and not the email address.
    However, I did not find in the body metadata section that it contains sender's display name to which a condition code can be written.
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Check the name of the sender will take another step.
    After the trigger, add 'Send an HTTP request' from Office 365 outlook.
     
    URI:
    https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages/@{triggerOutputs()?['body/id']}
    Method: Get.
     
    others can leave as default.
     
    Then the condition will be 
    body('Send_an_HTTP_request')?['sender']['emailAddress']['name'] 
    is equal to
    Peter Parker
     
     
     
     
  • CU24071757-2 Profile Picture
    11 on at
    Thank you @stampcoin, this works now.
    However, it looks like it takes 2-3 seconds in my inbox before it is moved to the other folder. Generally when we create message filter rule, messages do not even appear in the inbox, they are redirected before they land in the inbox. Can we do something in Power Automate too?
     
    Additionally, I tried to use "contains" condition instead of "is equal to" but that does not seem to be working. e.g., name "contains" - "Pater".
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    Not much you can do for example like using rules in outlook.
    Even if put the condition in the trigger, I don't think it can reduce much time for you.
     
    for the problem you got, I believe you might type something wrong with the name.
    You can add a compose , take body('Send_an_HTTP_request')?['sender']['emailAddress']['name'], and then compare if the name is similar what you typed.
    (As you mentioned Peter Parker, but now it's Pater).😊
     
     
  • CU24071757-2 Profile Picture
    11 on at
    Hi @stampcoin 
    Thanks for noticing the typo in my earlier post :)
    However, there was no typo in my "contains" condition. Having said that, "contains" works now for the new system generated emails.
     
    Earlier, to test this quickly, I was moving already-filtered-emails back to inbox but the flow got triggered only for one such email (12:05 pm email), but when I tried testing with more filtered emails (prior to 12:05), it looked like flow did not even know if there was a new email in the inbox. I don't know why is that, but at least the new flow with "contains" working for new system generated emails.
     
    Thank you for your help.
     
    I really wish if there was a way to pre-process this so that such emails does not even appear in my inbox for even a second. The reason is, I am also using Outlook mobile app, and since these emails are popping up in my inbox, I get a mobile notification that I have a new email, which is little distracting.
  • Verified answer
    stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    I am glad it works now. 
    Please mark it as answered.
     
    For you phone notification, you may want to combine Favorite People.
    It will take you a while for compose your favorite people.😊exclude Peter.
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard