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

Matching words in e-mail body to ever-changing list of words

I'm building an automated Flow that is triggered when an e-mail arrives

The Flow reads the body of the e-mail and needs to check to see if there are any words that match a list of words in a SharePoint document. If any words match, I have several conditions to run through.

 

I cannot, for the life of me, figure out how to do this. Surely, there's a way to match words between e-mail body text and a SharePoint document. The document will be ever-growing, so, a simple hard-coded expression can't suffice. Thoughts?

 

I have a few flows that check the Subject for reply/forward info and can work with those, but this one is kinda killing me.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Matching words in e-mail body to ever-changing list of words

@jbuis 

A SharePoint list would be a much easier option... quick example working Flow below:

SharePoint list config

a.png

 Flow Config

It's pretty simple... get all the items from the list and check whether the 'body' string contains the word

b.pngThis was the email:

a.png

And the results:

a.png

 

a.png

 

This should have you up and running 🙂

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

 

View solution in original post

6 REPLIES 6
Highlighted
Super User
Super User

Re: Matching words in e-mail body to ever-changing list of words

Hey @jbuis 

It's fairly simple to read the body of an email into a string (removing all the HTML tags, see below:

a.png

 b.png

 There may well be some better ways to do this... so please community users also share your thoughts 🙂

The obvious challenges is getting the words out of the document... you could:

1. Convert the source document containing the search words to PDF format

2. Use the Encodian 'Get PDF Text Layer' to obtain all the words in the document.

3. Use a string expression to split the Text layer into an array of words

4. Loop through the array and use a string expression to validate whether the word can be found in the HTML body string... then run your custom processing.

The obvious question / comment... this would be a lot easier if you stored the words in a SharePoint list rather than in a document... whilst the steps I outlined would work, it just feels like a bad solution.

I have a quick look at Azure cognitive services and I couldn't see an obvious way of searching for matching content...

Anyhow... hopefully some food for thought.

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

Highlighted
Frequent Visitor

Re: Matching words in e-mail body to ever-changing list of words

Thanks! I appreciate the response! I have the Html_to_text in there already, I probably should have mentioned that. From there, I can work with the body text, but can't seem to find a way to match between words. I certainly am not married to using a document, and do agree that a list would be better. Your idea should work-- I will dig into it for a proof of concept for the team. By all means, if you think something else up, feel free to share! 🙂

Highlighted
Super User
Super User

Re: Matching words in e-mail body to ever-changing list of words

@jbuis 

A SharePoint list would be a much easier option... quick example working Flow below:

SharePoint list config

a.png

 Flow Config

It's pretty simple... get all the items from the list and check whether the 'body' string contains the word

b.pngThis was the email:

a.png

And the results:

a.png

 

a.png

 

This should have you up and running 🙂

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up

 

View solution in original post

Highlighted
Frequent Visitor

Re: Matching words in e-mail body to ever-changing list of words

You're a rockstar @Jay-Encodian ! That really gets me moving now! Thanks every so much, mate!

Highlighted
Super User
Super User

Re: Matching words in e-mail body to ever-changing list of words

My pleasure @jbuis , thanks for thanks 🙂

Highlighted
Frequent Visitor

Re: Matching words in e-mail body to ever-changing list of words

🙂

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (7,424)