How to search a keyword from excel and make a list of them?

Hi!

I made a program that gets all my mails (with subjects and body) and puts them to excel. Now I should get mails with specific keyword “HOKS” (on subject or body) and make a string variable of them.

Now I have everything ready on my excel, but I don’t know how to make a string variable containing all the details (subject and body). Help really needed!

Regards,
Jennie

Hi @jennie.kari

Once the data is stored in an excel, you can use Excel activity ‘Read Range’ to read the sheet into a datatable variable. You can access the values by referring to the column names under which they are stored.
Example:

  1. Assume that your excel sheet has two columns: “Subject” and “Body”
  2. Read Range “Sheet1” → Store in dtEmails
  3. Use For Each Row activity → for each row in dtEmails
    Assign → subjectLine = row("Subject").ToString
    Assing → messageBody = row("Body").ToString