How to search if the Email (transactionItem) subject and body, contains keywords (stored in a datatable)?

Hello, I have trouble sorting my emails.
I have 2 data tables with keywords.
I need to use the 2 data tables to check if my Email (subject and body) contains one of the keywords stored in my data tables.

I read the data tables in process transaction I hope this is fine?


Hello @E_lanotte,

If reading the data tables produce the same result, it might be better to do it in InitAllApplications stage and pass it to the process.

1 Like

So like this in the process is not good?

the content of your csv files won’t change in the process, right? Read the csv files in Init.

If you might need to iterate over and over again over the datatables but intialise the datatables once for all.

EDIT: If your goal is to load a list of words from two files and search for mails “matching” these words, you might consider the following if your approach is slow:

  • normalizing searched words
  • build an HashSet of searched words
  • for each mail:
    • split mail to a “list” of normalized words
    • check for intersection between searchedwords and mailwords

Depending of the words, you might need a more NLP approach.