EDIT: I believe I found a solution by using regex to search the email text using every name in the column, by aggregating the names into a list separated by “|”. So, email comes in, then 1. Table Aggregator to aggregate the colum rows into a list separated by “|”, and 2. Text Parser module with the Pattern set to the list created by the Table Aggregator, and the Text set to the email text. In other words I used the formula
x = re.findall(“John Smith|Jane Doe”, emailtxt).
I have a list (google sheets column) of over 400 names. I am trying to make a workflow which, when an email arrives, searches the text of that email for any of those 400+ names. If the name is found in the Email, it writes that to a different Sheet.
In other words: If [Name] in [Email Text], output [Name]. (##[Name] could be any one of 400+ possibilities)
For example, I have the following column in Sheets:
Name
John Doe
Jane Doe
John Smith
Jane Smith
…
…
And I want to search the following email Text for any of these terms (since I don’t know which will be in the email), and then ouput the matched term into another Sheet (I can handle that last part).
I believe I could use an Iterator or other method to search the email text for each Name one at a time. However, I don’t want to use 400+ operations each time an email comes in. Is there any way to search the email Text with all the names from the Sheets column using a single / a few operations? If I aggregate the column rows? Or somehow using “Search Rows (Advanced)” using a Query? Or am I stuck having to search the email text once per possible name?
Also note that the emails that come in will have varying formats, so I don’t think I can do a regex match / extract based on a pattern.
Thanks for any help!!