Not able to Extract table from Mail Body

I am working on extracting a table from the body of an Outlook email. Initially, I attempted to convert it into .MHT & .eml format and then applied data scraping/table extraction methods. Unfortunately, these methods proved ineffective as the content was not recognized as a table. How can I successfully extract the table from the email body?

Hi @Ajinya_jorwekar

Did you try to use read outlook email ? It will give you str variable. You can either convert the html value to datatable or use generate data table activity to convert String to data table.

Hope it helps

Hi @Ajinya_jorwekar,

You can follow the below approach:

  1. Read the mail body in HTML format, for ex YourMailMessage.BodyAsHtml
  2. Use a Regex like <table.*?>(.*?)</table> (customize according to your table structure) and extract the table values



*Use the “Get Outlook Mail Messages” activity to get the email content.

*Use string manipulation functions to extract the table content. You can try using regular expressions or specific string operations to identify the table structure within the email body.

  • Once you have extracted the table content as a string, you can use the Generate Data Table activity to convert it into a DataTable.

String manipulation-> tableContent = emailBody.Substring(startIndex, length)