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 / How to filter 3 differ...
Power Automate
Suggested Answer

How to filter 3 different emails coming from a single user

(3) ShareShare
ReportReport
Posted on by 8
I receive 3 emails with different subject from a single user.
I want to filter the subject of each one and make sure all 3 emails have arrived.
Once verified that all 3 emails have arrived, a teams chat notification will be sent.
Categories:
I have the same question (0)
  • Suggested answer
    Vish WR Profile Picture
    2,253 on at
     
     

    Use a cloud flow with “When a new email arrives” trigger, filter by sender, then identify each email using subject keywords (A/B/C). Store each arrival in a SharePoint list or Dataverse table, and after each insert, check if all three types exist for that sender (count = 3). Once all are received, send a Teams notification.

    High-level flow:

    1. Trigger → New email arrives

     

    2. Condition → Check sender + subject type (A/B/C)

     

    3. Action → Store email type in tracking list

     

    4. Action → Retrieve records for that sender (today)

     

    5. Condition → If all 3 types exist

     

    6. Action → Send Teams chat notification

     
    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 
  • Suggested answer
    11manish Profile Picture
    1,937 on at
    You’re trying to do is a “wait until all expected emails arrive, then trigger once” pattern.
     
    Power Automate doesn’t have this out of the box, so you need a state-tracking approach.
     
    You cannot directly “wait for 3 emails” in one flow.
     
    The correct solution is to store the state (in SharePoint/Dataverse), track each email as it arrives, and trigger the Teams notification only when all three are
     
    received.
  • Suggested answer
    Valantis Profile Picture
    4,810 on at
     
    The cleanest way to do this is with three separate flows that each watch for one specific email, then write to a SharePoint list or Dataverse table when their email arrives. A fourth flow monitors that table and sends the Teams notification once all three are logged.
     
    Here's the pattern:
    Flow 1, 2, 3 (one per email):
    - Trigger: When a new email arrives (Office 365 Outlook)
    - Filter: From = the specific sender AND Subject contains your keyword for that email
    - Action: Create item in a SharePoint list with columns: EmailType (1, 2, or 3), ReceivedDate, and a shared GroupKey (e.g. today's date or a reference number from the subject)
     
    Flow 4:
    - Trigger: When an item is created (SharePoint)
    - Action: Get items from the same list filtered by GroupKey
    - Condition: Count of items where GroupKey matches = 3
    - If yes: Post Teams message
     
    The GroupKey is important  it ties the three emails together so you know it's the same batch. If these emails always arrive on the same day, the date works. If there's a reference number or order number in the subject, that's better.
     
    A simpler alternative if all three always arrive within minutes: use a single flow triggered by the first email, add a Delay (e.g. 10 minutes), then use Get emails with filters to check all three subjects have arrived, and only send Teams if all three are found.
     
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Suggested answer
    Haque Profile Picture
    2,352 on at
    Hi @RR-30040236-0,
     
    You need candidate componets like Outlook connector, SP list(for better clarity), Teams  and PowerAutmate flow.
     
    First let's have SP list for tracking things better,I wold suggest to have these columns in the list:
     

    Let's follow these step-by-Step Flow Design:

    1. Trigger: Use the trigger "When a new email arrives" from the Outlook connector.
    2. Initialize Variables: Initialize a string variable SenderEmail with the sender's email from the trigger. Also, initialize another string variable EmailSubject with the email subject.
    3. Filter Emails by Sender and Subject: Use a Condition action to check if SenderEmail matches the target user email. Add another Condition or Switch action to check if the EmailSubject matches one of the 3 expected subjects.
    4. Add or Update SharePoint List Item: Use the SharePoint "Get items" action to check if an item exists with the same Title (sender email) and Subject. If not found, use "Create item" to add a new record with sender email, subject, received date, and status. If found, optionally update the ReceivedDate or Status. For bette conditional checks.
    5. Check if All 3 Emails Have Arrived: Use "Get items" to retrieve all items for the sender email. Use a Filter Array action or expression to check if all 3 distinct subjects are present. Example expression to check count: length(body('Filter_array')), Compare the count to 3.
    6. Send Teams Notification: If all 3 emails are received, use the "Post a message in a chat or channel" action from the Microsoft Teams connector. Customize the message to notify the relevant user or team (if needed)
    7. Optional Reset or Archive: Optionally, clear or archive the SharePoint list items for that sender to prepare for the next cycle.
     

    Example Expressions

    • Filter Array to find matching subjects:

      @and(equals(item()?['Title'], variables('SenderEmail')), or(equals(item()?['Subject'], 'Subject1'), equals(item()?['Subject'], 'Subject2'), equals(item()?['Subject'], 'Subject3')))
    • Check if all 3 subjects exist:

      length(body('Filter_array')) == 3
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!

     

     

     

  • Suggested answer
    sumit_artesian Profile Picture
    78 on at
     
    As everyone else in this thread suggested, having a state-tracker/managing states using a SharePoint list or Dataverse would definitely work. But there is a clever way you can achieve your requirement in a single flow as well.
     
    Here is my suggestion on how you can send a notification on Teams when all three emails from the sender arrive without needing to configure a state-tracker:
    1. Create a flow and use the "When a new email arrives (V3)" trigger. Configure the "From" and "Subject Filter" parameter of the trigger. Enter the email address of the sender and for the subject, add some line that is present in all three emails. This will ensure the flow only triggers for one of the three valid emails that you are looking for.
    2. Use the "Get emails (V3)" action, but apply a filter query. The idea here is that once you have verified the new email is one of the three emails that you are looking for, you check to see if, on that particular day, there are other emails from the same sender with other subjects added to the filter query with the OR operator.
    3. Add another condition to check for the number of emails returned from the previous step. 
    4. If the number is exactly equal to three, send the notification and terminate.
    5. If the number is less than three, do nothing.
     
    What this flow does is:
    • When you receive the first valid email, it checks to see if all three emails arrived on that particular day. Only one email is returned, so the flow does nothing.
    • When you receive the second valid email, it checks to see if all three emails arrived on that particular day again. Only two emails are returned, so the flow does nothing.
    • When you receive the third valid email, it checks for all three and finds all three on that particular day, so it sends the notification on Teams.
    • For any other email received that does not match the subject or did not come from that particular sender, the flow does nothing.
     
    This lets you achieve your requirements without needing to constantly manage states.
     
    Here are some screenshots on how you can set something like this up:
    Overall flow:
     
    Trigger: When a new email arrives (V3)
    Note: Ensure you put a subject filter that is present in all three emails. I sent three emails with the subjects, "ONE OF THE THREE EMAILS: FIRST", "ONE OF THE THREE EMAILS: SECOND", and "ONE OF THE THREE EMAILS: THIRD", which means having "ONE OF THE THREE EMAILS:" as a subject filter would trigger for all of them. In case your subjects are all unique, you can use the Filter Query parameter as well to use the OR operator.
     
    Action: Get emails (V3)
    Note: Make sure you use the same Subject Filter (or Filter Query in case subjects are all unique) and the same From value as your trigger.
     
    Action: Condition
    Expression: 
    length(outputs('Get_emails_(V3)')?['body/value'])
    is equal to 3
     
    Action: Post message in a chat or channel
     
    Here are the three times the flow triggered:
     
    And the message received on Teams only when the third email arrived:
     
    Let me know if you have any other questions.
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item.
    If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like! 🩷
  • RR-30040236-0 Profile Picture
    8 on at
    Thank you very much everyone for the suggestions.
    I am new to power automate and will try them.
    Appreciate the help
  • Vish WR Profile Picture
    2,253 on at
     
    If you fine tha answers provided is correct please mark them as verified 
     
    Vishnu WR
     
    Please  Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 711

#2
Vish WR Profile Picture

Vish WR 691

#3
Haque Profile Picture

Haque 525

Last 30 days Overall leaderboard