Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

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

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?

Community Support Team
Community Support Team

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

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:


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:



Alice Zhang

Helpful resources


Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!


Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!


Microsoft Learn

Learn how to build the business apps that you need.


Power Platform World Tour

Find out where you can attend!


Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 322 members 5,717 guests
Please welcome our newest community members: