Extract table from email body

Since it is structured, i used Data scraping and this is what happens

image

@Palaniyappan to your question about screen scraping, here is the error:

We got three methods in screen scrapping
Like full text, native text and ocr
Is this error coming in other two methods as well

Cheers @KP6689

Hi Sourav,

I have an email table like below,

image

The column headers have a colspan=2 attribute.
The Table data fetched using your activity in this case is not accurate as below,

Any idea how to get the correct data for the tables which have colspan?

Thanks

Hi Sarathi,
which activity used in side the attache browser before output data table activity …Thanks

@Raju_Sigi_Reddy,

The Activity is UiPath.Core.Activities.ExtractData

Thanks for your reply…
image

unable to find this activity (UiPath.Core.Activities.ExtractData ), Which package need to install to get this activity.

@Raju_Sigi_Reddy,

You need import this package - UiPathTeam.ExtractDataTablesFromHTML.Activities

Hi Sourav,
Thanks for creating the custom activity for extracting tables from the mail body.
But it seems this activity is only working for email extracted from outlook activity and not from O365 or ExchangeMail activity.

Is there any way of extracting tables from emails extracted by O365 or exchange activity as we are discontinuing the usage of outlook-related activity due to frequent ‘Not responding’ of outlook client.

Note: I’m converting the output of O365 get the email to List

Please provide your input.

Thanks

@Vinod_Swain, try like this extract the body of the email, as you were saying to extract the Table content, so look for table tags in the body, then try to loop the “TH” tags as your data table headers and remaining “TD” tags as your content.

Dear @S_Srobot,

You can use
Get-Table-From-Email-With-UiPath.zip (16.5 KB)

Regrads,

1 Like

Hello @S_Srobot
I’m Luis Fernando, and I’m working on a automation with this exact requirements. I was wondering if you found a reliable solution, and in case you did, be kind enough to talk to me a bit o how you made it. Let me know, really looking forward to your response.
Thank you and Regards.

Hello Sourav

How can I reach this activity, the link directs me to the homepage.

Hi,

please find attached the workaround to save datatable from the email while using o365 activity.
The idea is to save the mail as local in .HTML format and then open the file in the browser and extract the table using Data Scraping. In my case since I need only the first table, the solution works for me.
GetTableFromo365EmailBody.zip (7.2 KB)

Hi Sourav,

The custom activity you created is really helpful and it worked very well. Now the issue I am facing is, I am using Office 365 scope and reading the mail with GetAs HTML checked.
Once I have the output I have converted UiPath.MicrosoftOffice365.Models.Office365Message to System.Net.Mail.MailMessage

This conversion is also fine everywhere, but when give this as input to the custom activity it is throwing an error saying

Extract tables from email: Value cannot be null.
Parameter name: html

I am not able to get where exactly is the problem. If you can help on this it would be a blessing.

Also others if you are reading this message please have an engagement on this and if you find a solution please post it here.

Looking forward for the response.

image
Hi Pal,

I can’t find the package, could you help me?

Thanks

Can’t open the url

Hey @Zoeyu ,

Download the package from the marketplace and import it into your project.

Thanks,
Sanjit

1 Like

How to import that package to my project?
Thanks

1 Like