cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
kcordell
Level: Powered On

Creating a condition if email subject contains any keywords

Hello,

 

I have created a Flow to match a specific set of words in an email subject, however, I want to filter out the following words: Re, RE, Fw, FW, Fwd, FWD, Automatic reply. If the subject contains any of those words, I do not want the flow to continue.

 

I set up a condition that tries to match those words to an array, but that didn't function as I had hoped. I also tried an "Apply to each" against that array, but that still failed. 

 

This is where I left it. I want it to check against each item in the variable.

 

replyFilter.png

 

I'm sure that I'm not implementing it correctly, so apologies for my lack of understanding in regard to context -- I'm still learning. Searches have not resulted in a working solution. If someone can help point me in the right direction, it'd be much appreciated.

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Creating a condition if email subject contains any keywords

Hi @kcordell,

 

Please try to combine function Or with Contains in the condition to filter emails based on the subject.

 

The flow could be simple configured likes below. The code in the Condition is:

@or(contains(triggerBody()?['Subject'], 'Re'),contains(triggerBody()?['Subject'],'FW'),contains(triggerBody()?['Subject'],'Fw'),contains(triggerBody()?['Subject'],'Automatic reply'))

1.PNG

 

Please take it for a reference.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Creating a condition if email subject contains any keywords

Hi @kcordell,

 

Please try to combine function Or with Contains in the condition to filter emails based on the subject.

 

The flow could be simple configured likes below. The code in the Condition is:

@or(contains(triggerBody()?['Subject'], 'Re'),contains(triggerBody()?['Subject'],'FW'),contains(triggerBody()?['Subject'],'Fw'),contains(triggerBody()?['Subject'],'Automatic reply'))

1.PNG

 

Please take it for a reference.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

kcordell
Level: Powered On

Re: Creating a condition if email subject contains any keywords

That did the trick. Thanks so much!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (5,067)