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

Community site session details

Session Id :
Power Automate
Unanswered

E-mail retrieval

(0) ShareShare
ReportReport
Posted on by

Hi,

 

New to flows - I'd like to set up a flow that allows users to e-mail me and have the flow push them back e-mails that have the same subject line.

 

eg. I have an e-mail in my inbox labeled "Site Alpha" w/ an attachment. A user sends me an e-mail with the subject "Site Alpha". I'd like the flow to automatically forward them the original "Site Alpha" e-mail (and attachment) that was in my inbox.

 

Is this possible? If so, how do you set it up? It seems like you'd want to use Get E-mails but I can't get it to work.

 

Any help would be appreciated, thank you!

 

Edit: To add, this would be dynamic. One user might ask for Site Alpha, another might ask for Site Beta, another for Site Zeta, etc - I'm not looking for "Site Alpha" but rather whatever the subject line is.

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    on at
    Re: E-mail retrieval

    Hi @techstudent7,

     

    I have made a test on my side and please take a try with the following workaround:

    • Add “When a new email arrives” trigger, Subject Filter field set to Site Alpha.
    • Add a “Get items” action, Fetch Only Unread Messages set to No.
    • Add a “Filter array” action, From set to output of “Get emails” action, click “Edit in advanced mode”, type the following formula:
    @and(equals(item()?['Subject'], triggerBody()?['Subject']),not(empty(item()?['Attachments'])))
    • Add a “Apply to each”, Input parameter set to output of “Filter array” action. Within “Apply to each”, add a “Forward an email” action, Message Id field set to Message Id dynamic content of “Filter array” action, To field set to From dynamic content of the trigger.

    Note: There is a limit in the amount of emails that the “Get emails” action retrieves, the “Get emails” action could only retrieve at most top 25 emails once, if your original "Site Alpha" e-mail is not in top 25 emails, the “Get emails” action would not retrieve it.

     

    Image reference:13.JPG

     

    14.JPG

    The flow works successfully as below:15.JPG

     

     

    Best regards,

    Kris

  • user53 Profile Picture
    21 on at
    Re: E-mail retrieval

    Hi @v-xida-msft

     

    Thanks, this seems to work. However, I need the original filter to be dynamic. There are several thousands "sites" people might e-mail me about and I can't set up flows for each. Is there any way to make the subject search more dynamic?

  • user53 Profile Picture
    21 on at
    Re: E-mail retrieval

    @v-xida-msft

     

    Hi, actually figured the dynamic part out - is it possible to "Get Emails" from a shared inbox?

     

    Thanks!

  • v-xida-msft Profile Picture
    on at
    Re: E-mail retrieval

    Hi @user53,

     

    Creating a connection to a Shared mailbox is not supported in Office 365 Outlook connector of Microsoft Flow currently, there is no way to "Get Emails" from a shared inbox in Microsoft Flow currently.

     

    Best regards,

    Kris

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 462 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 456 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard