I am trying to forward two tables (each from seperate mail) in one mailbody, but I dont know how to extract the tables from the other informations in the Body. I know, that i can copy the mailbody as an html string. But currently Im stuck. I would appreciate it, if someone could help.
the issue is following: I get two different mails with a certain format, a little bit text and one datatable in each. I want to copy these two datatables in one mail to forward it, without changing the format, but in the mail body. Not as an attachment. If I extract it as a DataTable type, I am loosing the format. I thought about extracting the DataTables by html tags but it is too complicated….
I can paste the datatable in another mail if I copy the whole html code of it. But I only need the table, without all the other informations above or under it.
Another issue is, that the html includes lots of format codes, which are making it more difficult than it is.
unfortunately, it contains sensible data. I do not want to join the tables. I only want to copy each from mail a and b to mail c. The result should be two tables among themselves.
Currently I am trying to do it by getting the htmlcode with mail.Headers(“HTMLBody”).ToString, editing it with regex (to delete all the other elements except the table itself)and after that, pasting the html code in the email body.
I do not know whether it will work but we will see. Do you have any other ideas?
@kadir.kilincarslan According to your requirements, this should be the ideal case. We just need to get the HTML Table format Code and append it with other HTML table code and use it as the Mail Body. As you have mentioned, regex should work in a very good way.
Not the complete But i had done the operations after the extarction of table from mail body ,
how it can be appened in single mail body like this
For extarction of data from the mailbody u can either use the activity of extraction of table from mail or can follow the below link : Extract table from email body
Also try this way of extracting table from mail body
After getting html format of tables from mail body try to split the text since the html part of tables has tag named lke that , do some string manipulation accordingly to get only data between <table></table>
After extraction of datatable , u can follow the steps in workflow for understanding the logic part : Main.xaml (23.6 KB) sample1.xlsx (8.2 KB) sample2.xlsx (8.2 KB)
sample excel files used for demonstarting this
i had designed the workflow which write the datatable irrespective of no of columns in the datatable