cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
misc1234
Frequent Visitor

Multi-level filter for keywords in subject when using "new email arrived in a shared mailbox" action

Hi there,

 

I have been using a subject filter when using "new email arrived in a shared mailbox" for when specific keywords are used in the subject title. However, I would also like to option to exclude certain words (Re: and Fwd:) as when replying to the email - it would re-trigger the flow. Any advice on how to achieve this?

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@misc1234 

Ah, ok.  So the subject filter query won't really let you exclude anything.  (At least, that I can tell)...

 

BUT...we can do a trigger condition to have the same effect:

  • On your trigger, click on the ellipses ('...') on the top right, and select "Settings".
  • Down near the bottom is the section for Trigger Conditions, click "Add"
  • A little box will appear, paste this whole thing into it:   @and(equals(startswith(triggerOutputs()?['body/subject'],'FW:'),false),equals(startswith(triggerOutputs()?['body/subject'],'RE:'),false))
  • Click Done at the bottom, and carry on with your flow.

eMails that begin with FW: and RE: should be ignored, everything else should go through.

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

 

View solution in original post

6 REPLIES 6

@misc1234 

Hi there.  It seems like an OData filter would work (depending on your trigger/action).  This article is really good for the syntax even though it's talking about a different connector, it should work: Every Power Automate (MS Flow) Filter Query You Ever Wanted To Know As A Functional Consultant.

 

Take a look and let us know how that works out.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Thanks for the reponse @edgonzales - i've already had a look at this article however not having any luck incorporating the syntax as it is not a generic filter but a specific "subject filter" input option hence the "fieldname" entry is already defined. 

 

I've tried using the syntax in the "subject filter" however it doesn't seem to work? any tips?

Gotcha.  What are you using as a trigger.  I'll build something real quick and test it out.

-Ed

 

I'm using the "when a new email arrive (V3)" trigger and wanting to use the "startwith" filter query for the subject line.

 

Thanks.

@misc1234 

Ah, ok.  So the subject filter query won't really let you exclude anything.  (At least, that I can tell)...

 

BUT...we can do a trigger condition to have the same effect:

  • On your trigger, click on the ellipses ('...') on the top right, and select "Settings".
  • Down near the bottom is the section for Trigger Conditions, click "Add"
  • A little box will appear, paste this whole thing into it:   @and(equals(startswith(triggerOutputs()?['body/subject'],'FW:'),false),equals(startswith(triggerOutputs()?['body/subject'],'RE:'),false))
  • Click Done at the bottom, and carry on with your flow.

eMails that begin with FW: and RE: should be ignored, everything else should go through.

 

Keep us posted.

-Ed

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

 

Thanks, seems to work!

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power automate tips 768x460 v2.png

Restore a Deleted Flow

Did you know that you could restore a deleted flow? Check out this helpful article.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

Users online (3,784)