Extract table from email body

in that case save them as a excel file with filename as “filename”+"_"+now.ToString(“hh_mm_ss”)+".xlsx"
so that each time it will create a new workbook
–and also the datatable variable obtained must be cleared out and it has to be done at last in each loop with a CLEAR DATATABLE ACTIVITY where mention the datatable variable as input

Cheers @S_Srobot

okay thanks brother, will try this and discuss.

1 Like

I have got the tables using ‘extract datatable from html’ activity, its a custom one. It will fetch me all the tables inside any email body. Also one thing you need to be clear about will be the background structuring of the email (its formatting) like where is table where is list or other items. As I had many embedded tables but was able to see only 2 of them so in that case you can ask the sender of email to work on this or you can provide a simpler template to them which will be as per ease to be read by bot.

Thanks guys for responding and guide me through this issue.

Custom activity to extract tables from email:

It takes mailmessage as an input and returns a dataset with all the table content in the email.

Hi @Palaniyappan, Im having a problem in the XML metadata section (still not too sure)

Please find attached my file:

Read_Outlook.xaml (15.2 KB)

Do let me know, what needs to be done, will be extremely grateful.

May I know what is the input format


tbh, i wont act as if I can distinguish one screen scraping activity from another.

Tried “screen scraping” too throws an error, tried converting .mht to .html doesnt work either.

Its super confusing, please help

May I know what is that error

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


@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,


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?


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


The Activity is UiPath.Core.Activities.ExtractData

Thanks for your reply…

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


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.


@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)