Extract DataTable from email

Hi all, i am trying to extract datatable from a different email , by after i extract i tried to write into excel but the output only have 1 datatable appear . I have insert “*.mht” as wildcard but it not working can someone help me with this issue ?
Main.xaml (27.3 KB)

@xiangyun.koh,

You had declared ExtractDataTable multiple times. I removed those ad added Merge Data Table to merge all emails output to single datatable.

This should work now.
Main.xaml (26.3 KB)

Thanks,
Ashok :slight_smile:

Hi @xiangyun.koh

Please check this

Regards,

Get IMAP Mail Messages:

  • Drag and drop the Get IMAP Mail Messages activity.
  • Configure the properties (Server, Port, Email, Password, etc.)

Loop Through Emails:

  • Use a For Each activity to loop through the list of retrieved emails.

properties

Extract DataTable from Email:

  • Inside the loop, use the Assign activity to extract the body or attachment content.
  • If the email contains .mht attachments, save the attachment to a temporary location and read it.

Example for extracting .mht content:

Read .mht Content and Extract DataTable:

  • Use custom logic or libraries to parse .mht files and extract the datatable.

Write Extracted DataTable to Excel:

  • Use the Excel Application Scope to open the Excel file.
  • Use the Write Range activity to write the datatable to the Excel file.

hi thanks of answering my qn but i try out the workflow the output still have the same issue

i have the same exact work process and i use wildcard “*.mht” to open up the different email but i face issue when writing to excel , i only duplicate of the same datatable that was extracted from 1 email

@xiangyun.koh

Hope this would help you solve

Cheers