cancel
Showing results for 
Search instead for 
Did you mean: 

How to read email body which in Tabular Format

MohanV
Staff
Staff
Dear Experts,

As part of a requirement I have created an Object which reads Outlook Email  and write into DB Table.
My Object reading the Email body as text, but some email's body we get in the form of Table. 

Can some one please help me how to handle this type of scenario? so that I can read email body (tabular) and write into table in readable format. Example email body as below.

35168.png
1 BEST ANSWER

Best Answers

Soumya21
Level 6
Hi @Mohan V

You can extract table in collection for that you need to get email body in html format and extract only table portion of html code and pass it on HTML Agility pack which i have attached in this. By using this action, you will get table in collection.

Thanks​

View answer in original post

3 REPLIES 3

Soumya21
Level 6
Hi @Mohan V

You can extract table in collection for that you need to get email body in html format and extract only table portion of html code and pass it on HTML Agility pack which i have attached in this. By using this action, you will get table in collection.

Thanks​

MohanV
Staff
Staff
Hi @Soumya K , Thank you very much for the reply.
I have utilized object "HtmlAgilityPack" shared by you, and passed email body (HTML) to it and set Output as "Collection".
When running the process I am seeing error as "​Internal : Could not execute code stage because exception thrown by code stage: Object reference not set to an instance of an object." .   Being a beginner with BP,  I am not getting a clue to resolve this , could you please help?
Below is snapshot of my process.  You can see "Body" has data when process reached to "HtmlAgilityPack".  



35167.png

Soumya21
Level 6
Hi @MohanV
That error may be because of Table headers are in td format in html body of an email, if you change tables headers to th format it may work

Thanks
Soumya