Showing results for 
Search instead for 
Did you mean: 
Level: Power Up

Mail subject filter OR

Hi. I want to be able to trigger the saving of attachments from an email if the subject contains 'Invoice' OR 'Bill'. I have searched but cannot find the syntax for this anywhere? Is it possible? 


I have the flow working with just the word "Invoice" but I need to specify other keywords as well 


It must be simple!





Not applicable

Re: Mail subject filter OR

  1. You'll have to insert a 'Conditional' step. Setup your conditional to "find" one of the search words you're looking for, "invoice," for example. I know you stated you are looking for "bill" as well. You're simply going to leverage the auto-generated syntax of this conditional.
  2. You'll have to modify the syntax. Click the link that says, "Edit in Advanced Mode.'
    1. It should read as '@contains(...'
  3. Select that entire text generated and copy it to clipboard.
  4. Navigate to the beginning of the statement and start typing in the function @or(...)
  5. Paste the copied text (the auto-generated 'contains' function) into the wrapper of the '@or(),'
    1. Make sure to remove the '@' symbol from the '@contains' portion inside the '@or.'
    2. Adjust your search word in that function as necessary
  6. Repeat step 5 for as many words as you need the flow to search for

At the end your text should appear somewhat like the below:

@or(contains(items('Loop_through_Email_Attachments')?['ContentType'], 'officedocument'), contains(items('Loop_through_Email_Attachments')?['ContentType'], 'excel'))


The red text is part of the auto-generated text referenced in step 2. the blue text is the search key you're looking for.

Community Support Team
Community Support Team

Re: Mail subject filter OR

Hi @mbpeirce,


Do you need any further help on this topic?




Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Level: Power Up

Re: Mail subject filter OR

Very helpfull, Thank you!


Re: Mail subject filter OR

Hello, @mbpeirce!


Thank you for posting to the Flow Community Forum! It seems as though someone has offered a valuable solution to your issue! If you feel as though your issue has been solved and you are satisfied with one of the previous replies, please click "Accept as Solution" so that this thread will be marked for other users to easily identify as a helpful thread!


Thank you for being an active member of the Flow Community!



(Flow Community Admin)

Microsoft Flow Community Manager

Helpful resources


Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.


Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020


Flow Community User Group Member Badge

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


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 Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 215 members 3,893 guests
Please welcome our newest community members: