Extracting data table from e-mail message body


#1

Hi,
whitin the project I am working on I need to save within variable with type System.Data.DataTable data from the table placed within the Outlook e-mail message body. I have not found the way how to do it. :disappointed_relieved:
Table is simple - there are 6 columns, 4 rows, no merged cells.
So, I will be thankfull if someone can advice how to do it.


#2
  1. Save the mail as WebPage(In outlook you can save the mail as a file then open it and use save as)
  2. Open the saved WebPage
  3. Then extract the data using extract datatable

Not sure how you can do it if you’re not using outlook.


#3

akhi_s27 thank you for your answer!

I have already tried following:

  1. saved mail message as html file using UiPath.Mail.Activities.SaveMail
  2. opened saved html file using UiPath.Core.Activities.OpenBrowser

As a result of this html file is being opened but it do not look like e-mail message - table is deformated. It looks like html elements are not presented correctly. So, unfortunately opened html cannot be used to scrape data table. As I am new user it looks like in the forum I cannot upload files to add an example of how html is being opened by UiPath.

akhi_s27, have I understood correct that steps I made are steps you proposed?
Maybe there are solution for this or another way how to extract data table from e-mail body?

Interesting that if I am manualy in Outlook saving mail message as html file and then opening the file in IE, html file is being opened correctly - such html could be used for data table scraping. So, the problem with correct saving/opening of html is only if it is being done by UiPath.
Anybody have ideas why it is so?


#4

Hi VladisG did you find the solution I have same issue …


#5

Hi, hkjobs1988, no I have not found solution.
One expert adviced me following via e-mail - β€œI looked at the problem – and I couldnt get the save email to save the email in a resonable html format. You can however open outlook, open the mail and save to html – that will be in a perfectly readable format.” I have not tried yet, but going to try.

If you or someone else found solution please let me know here.

Regards,
VladisG


#6

Can you change the data and attach the mail message here?


#7

Hi, akhi_s27,
as I am new user it looks like in the forum I cannot upload files.
I have example mail message, but how can I share it with you?

VladisG


#8

Any solution for this


#9

Hi @VladisG @Kamesh , i had the same issue, and the only way to do it was to save the mail message with the extension *.mht (wich i discovered was a web page format for IE).
The datable is no longer disorted (only some typo due to the US encoding for French character).

Regard,
Bastien