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 / We want to check a mai...
Power Automate
Unanswered

We want to check a mailbox for emails received with specific Subject lines

(0) ShareShare
ReportReport
Posted on by 15

We're able to do this, but we want to be able to use an Array to search our mailbox for specific Subject lines from yesterday. 

If not found, we want to be able to send out an email with the Subject line that we searched.

 

Is this possible?

Categories:
I have the same question (0)
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @ kylep,

     

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

     

    • Add a Recurrence trigger, Interval set to 1 and Frequency set to day.
    • Add a "Get emails" action, specify Folder.
    • Add a “Initialize variable”, set the variable name as “contain subject”, set the variable type as “Integer”.
    • Add an “Apply to each”, choose the “Body” dynamic content of the "Get emails" action in the input field.
    • Add a Condition inside the “Apply to each”, click "Edit in advanced mode", type the following formula:

    @and(equals(items('Apply_to_each')['Subject'], 'my test'),greaterOrEquals(items('Apply_to_each')?['DateTimeReceived'], addDays(utcNow(), -1)))

    • Within "If/yes" branch of Condition, add an “Increment variable”, choose the “contain subject” in the “Name” field, fill in “1” in the value field.
    • Add a Condition 2 outside the “Apply to each”, the first value choose the dynamic content of the variable, the second value fill in “0”, the condition in the middle choose “is equal to”.
    • Within "If/yes" branch of Condition 2,add a "Send an email" action, you could fill in your search subject in the “Subject” field, fill the email address and email body.

     

    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:

     1.png2.png

    If there is no email on the inbox which’s subject is equal to “my test” from yesterday , the flow would run successfully as below to send the email:

     3.png

     

    Regards,
    Alice Zhang

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!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard