Trigger a flow based on email properties

Note

Microsoft Flow is now Power Automate. For more information, see this blog.

This content will be updated to reflect the branding change in the coming days.

Use the When a new email arrives trigger to create a flow that runs when one or more of the following email properties match criteria that you provide:

Property When to use
Folder Trigger a flow whenever emails arrive in a specific folder. This property can be useful if you have rules that route emails to different folders.
To Trigger a flow based on the address to which an email was sent. This property can be useful if you receive email that was sent to different email addresses in the same inbox.
From Trigger a flow based on the sender's email address.
Importance Trigger a flow based on the importance with which emails were sent. Email can be sent with high, normal, or low importance.
Has Attachment Trigger a flow based on the presence of attachments in incoming emails.
Subject Filter Search for the presence of specific words in the subject of an email. Your flow then runs actions that are based on the results of your search.

Important

Each Power Automate plan includes a run quota. Always check properties in the flow's trigger when possible. Doing so avoids using your run quota unnecessarily. If you check a property in a condition, each run counts against your plan's run quota, even if the filter condition that you defined isn't met.

For example, if you check an email's from address in a condition, each run counts against your plan's run quota, even if it's not from the address that interests you.

In the following walkthroughs, we check all properties in the When a new email arrives trigger. Learn more by visiting the frequently asked billing questions and the pricing page.

Prerequisites

  • An account with access to Power Automate
  • An Office 365 Outlook account
  • The Power Automate mobile app for Android, iOS, or Windows Phone
  • Connections to Office, Outlook, and the push notification service

Trigger a flow based on an email's subject

In this walkthrough, we create a flow that sends a push notification to your mobile phone if the subject of any new email has the word "lottery" in it. Your flow then marks any such email as read.

Note

While this walkthrough sends a push notification, you're free to use any other action that suits your workflow needs. For example, you could store the email contents in another repository such as Google Sheets or a Microsoft Excel file stored on Dropbox.

Ok, let's get started:

  1. Sign in to Power Automate, and then select the My flows tab.

  2. Select Create from blank.

    blank flow

  3. Search for "email", and then select Office 365 Outlook - When a new email arrives from the list of triggers. This trigger runs each time an email arrives.

    email trigger

  4. Select the folder that you'd like the flow to monitor for incoming emails, and then select Show advanced options.

    Note

    To display all your email folders, select the Show Picker icon, which is located on the right side of the Folder box on the When a new email arrives card.

    folder property

  1. In the Subject Filter box, enter the text that your flow uses to filter incoming emails.

    In this example, we're interested in any email that has the word "lottery" in the subject.

    Advanced options

    1. Select New step > Add an action.

    2. Search for "notification," and then select Notifications - Send me a mobile notification from the list of actions.

      Notification

  2. Enter the details for the mobile notification you want to receive when you receive an email that matches the Subject Filter you specified earlier.

    Notification details

    1. Select New step > Add an action.

    2. Search for "read", and then select Office 365 Outlook - Mark as read from the list of actions.

      Mark as read

    3. In the Mark as read card, add the MessageId token in the Message Id box.

      If the Message Id token isn't visible, search for it by entering Message Id in the search box.

      Message id

  3. Give your flow a name. Then save it by selecting Create flow at the top of the page.

    Save flow

Congratulations! You now receive a push notification each time you receive an email that contains the word "lottery" in the subject.

Trigger a flow based on an email's sender

In this walkthrough, we create a flow that sends a push notification to your mobile phone if any new email arrives from a specific sender (email address). The flow also marks any such email as read.

  1. Sign in to Power Automate, and then select the My flows tab.

  2. Select Create from blank.

    blank flow

  3. Search for "email", and then select Office 365 Outlook - When a new email arrives from the list of triggers. This trigger runs each time an email arrives.

    email trigger

  4. Select the folder that you'd like the flow to monitor for incoming emails, and then select Show advanced options.

    Note

    To display all your email folders, select the Show Picker icon, which is located on the right side of the Folder box on the When a new email arrives card.

    folder property

  1. In the From box, enter the email address of the sender.

    Your flow takes action on any emails that are sent from this address.

    Email property

    1. Select New step > Add an action.

    2. Search for "notification," and then select Notifications - Send me a mobile notification from the list of actions.

      Notification

  2. Enter the details for the mobile notification you'd like to receive whenever a message arrives from the email address that you entered earlier.

    Notification details

    1. Select New step > Add an action.

    2. Search for "read", and then select Office 365 Outlook - Mark as read from the list of actions.

      Mark as read

    3. In the Mark as read card, add the MessageId token in the Message Id box.

      If the Message Id token isn't visible, search for it by entering Message Id in the search box.

      Message id

  3. Give your flow a name, and then save it by selecting Create flow at the top of the page.

    Save flow

Trigger a flow when emails arrive in a specific folder

If you have rules that route email to different folders based on certain properties, such as the address, you may want this type of flow.

Let's get started:

Note

If you don't already have a rule that routes email to a folder other than your inbox, create such a rule and confirm it works by sending a test email.

  1. Sign in to Power Automate, and then select the My flows tab.

  2. Select Create from blank.

    Blank flow

  3. Search for "email", and then select Office 365 Outlook - When a new email arrives from the list of triggers. This trigger runs each time an email arrives.

    Search for email

  1. Select the folder to which you're routing specific emails. To display all email folders, first select the Show Picker icon, which is located on the right side of the Folder box on the When a new email arrives card.

    Select folder

    1. Select New step > Add an action.

    2. Search for "notification," and then select Notifications - Send me a mobile notification from the list of actions.

      Notification

  2. Enter the details for the mobile notification you'd like to receive when an email arrives in the folder you selected earlier. If you haven't already, enter the credentials for the notifications service.

    Notification details

    1. Select New step > Add an action.

    2. Search for "read", and then select Office 365 Outlook - Mark as read from the list of actions.

      Mark as read

    3. In the Mark as read card, add the MessageId token in the Message Id box.

      If the Message Id token isn't visible, search for it by entering Message Id in the search box.

      Message id

  3. Give your flow a name, and then save it by selecting Create flow at the top of the page.

    Save flow

Test the flow by sending an email that gets routed to the folder you selected earlier in this walkthrough.