Read Outlook Email Seach for Keywords

Hi All,

I am trying to read outlook emails from senders that are requesting a pdf cert that would be obtained on a website.

  • Read emails in a mailbox (Either one by one or All )
  • Search for iso code the sender is requesting (Sometimes they mention it in the subject and sometimes in the body)
  • Got to website get iso cert the customer is requesting
  • Send link to website where cert is to customer in email , either reply or separate email

Example of an email 1

Subject: Request for Renewed ISO Cert

Dear Supplier,

In review of our files it has come to our attention that your ISO 1234 and ISO 12345 certification has expired.

Another Example of potential email request

Subject: FW: ISO 1234567

Hi

Can you help me with this? xyz is requesting a new xyz ISO cert. The one on file expires 12/4.

Thank you!

Should i read these one by one , or read all emails export sender, subject, body to excel and go from there?

2 Likes

@jkibb

Welcome to the community !

I’ve found a way to do what you are looking for! After been working on it for hours :sweat_smile:

So check this out :point_down:

I use regex, to look for numbers after the word “ISO” on the subject and the body of the mail. If there’s any it will continue, so that you can add what ever you want, like getting the code and use it on the web and send the mail. If not it will do nothing !

SearchByKeyWordOutlook.zip (18.9 KB)

Give it a look and let me know how it goes for you :slight_smile:

1 Like

mz3bel,

Thanks! I will give this a look and let you know the results.

1 Like

HI
welcome to uipath community
both way runs at same pace. so we can go for the first method itself like
get all the mailmessage as a list and iterate through them one by one in a FOR EACH activity
Here you go with an xaml
hope this would help you resolve this
regexx (2).zip (30.2 KB)

Cheers @jkibb

Thanks…I am able to get the value either in the subject or the body and store into a variable.

Now i have another task

-Read existing Csv starting with row b2 and read each row to see if the text in the cell contains the variable and also contains a certain string ( lets say contains Variable as well as string(USA)

  • if it contains the variable and the string then store that cell number into another variable ( say it finds the variable and the string in cell b5 then store b5 into a variable )

Im not sure if this is even possible.

1 Like

Just want to clarify this. I think i can get by storing the contents of the cell into a variable if the variable and string is found.

1 Like

@jkibb

By using Read Range, you can choose wich range to start with and save it in a DataTable.

Later, use a dataTable.Select(“ ColumnName <> ’Var?’ ”).copytodatatable(), than save it using a Write Cell…

– Later, use a dataTable.Select(“ ColumnName <> ’Var?’ ”).copytodatatable() , than save it using a Write Cell…

Would this be an assign activity after i read the range and store into datatable? Or is this a datatable activity? Also how does this search each row for my variable and string? Im a little confused.

1 Like

@jkibb

Sorry, an assign Activity… dataTable = dataTable.Select(“ ColumnName <> ’Var?’ ”).Copytodatatable()

ok so dataTable.Select(“ ColumnName <> ’MyVariable?’ ”).Copytodatatable()

Is this where i would put my variable to search? And Also where do i put my string to search for the phrase or word USA? Or am i getting ahead of myself?

1 Like

@jkibb

Check if you get only “USA” words… dataTable.Select(“ ColumnName <> ’USA’ ”).Copytodatatable()

Can i do something like this?
Inside excel application scope
Read Range B2 output to dtAllLinks
Assign dtAllLinks if the variable IsoSubjectFound and also the string USA is found.

I get compile error string constants must end with a double quote

Also the string in the excel row i am reading is a link to a website so i think i need to use Contains variable and also contains USA. The link would be a long link that has both the variable name and USA in it along with other characters.

image

Hi

I am also having similar task and downloaded the program “SearchByKeyWordOulook”.
I am unable to run the program. Seems, few activities are missing.

Can Someone please help me?