web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Filter email based on ...
Power Automate
Unanswered

Filter email based on certain keywords

(0) ShareShare
ReportReport
Posted on by 6

Hi there, 

We are trying to find a way where we can filter emails based on certain keywords. 

Our team received a certain kind of email from a specific email address. In that email we want to search if certain keywords appear or not. If they do appear then we want to have close look at the email if not then we want the email to be deleted. 

We tried created a rule in Inbox of the Outlook where we created a condition stating that if the email comes from the specific address then the action is to move it to a new folder. 

Then in this new folder we created a rule that if "Message body includes" let's say the word "user" then the action is to move that email into inbox so that we can see it. 

This way we can contain all the email in the new folder from the specific email address and then move items from it to the inbox. 

However the problem we ran into is that Outlook doesn't gives an option to restrict filtering the email body to exact match of the keyword. For example- if we want soil treatment as a keyword then Outlook treat soil and treatment as separate keyword. 

During our test we found that if the email only contains treatment, it is still moved from the new folder to inbox. 

We only want email containing soil treatment to be moved from the new folder to inbox. 

 

After having no success with Outlook rules we tried to use Power Automate but we are not sure how to it setup. 

All we want is to filter an email from an specific email address based on certain keywords (we have over 100 of them) and if the email contains the keywords then keep them in inbox otherwise delete them, because we don't to read them as it is not relevant to us.

 

Not sure what is the best option. We could also try an app that works with Outlook, if it works.

 

Thanks 

 
Categories:
I have the same question (0)
  • arcado Profile Picture
    352 Moderator on at

    hi,

     

    Try this

     

    2.png

  • VictorIvanidze Profile Picture
    13,081 on at

    Try to use this flow as a base: https://ivasoft.com/sortemailsflow.shtml

    and modify it according your needs.

  • Username18 Profile Picture
    6 on at

    Thanks

    I tried but it gives an error.

     

    Username18_0-1706711794156.png

    Wondering in the first box "When a new email arrives" can we change it to "From" instead of "Inbox". Asking becuase we want to filter email from a specific email address not all the email in the inbox. 

    Also, in the last box for yes, will the flow work if we change move email and point it to Inbox and if no the email is deleted.

    This way, any email that doesn't contains keywords (in the main body of the email) that we are looking for are either deleted or moved to inbox. 

    I tried both ways. The one you mentioned here and the with the changes that I'm asking for but none of them worked. 

    I'll also mention that it's possible that the emails might not contain any of the keywords we are looking for or might contain some. We have over 100 keywords that we want to search in every email that from this sender. 

    We also want the keywords to be a exact match otherwise it doesn't helps and is same as setting up rules in the Outlook.

    The error in the second box from top is

    "BadRequest

    The variable 'Email Bid' of type 'Array' cannot be initialized or updated with value of type 'String'. The variable 'Email Bid' only supports values of types 'Array'."
  • Username18 Profile Picture
    6 on at

    Thanks 

    I couldn't try it. We are looking to sort email from a specific email address by keywords in the main body. 

    Any email that doesn't contain keywords that we are looking for should either be deleted or moved to inbox. 

     

  • VictorIvanidze Profile Picture
    13,081 on at

    Well, you can easily modify it.

  • Username18 Profile Picture
    6 on at

    Thank you for your help. But I've no expertise in Power Automate so not sure what changes to make to make it work.

  • VictorIvanidze Profile Picture
    13,081 on at

    It's time to learn! 😉

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 959

#2
Valantis Profile Picture

Valantis 872

#3
Haque Profile Picture

Haque 589

Last 30 days Overall leaderboard