Extract of table data and subject into same excel sheet

Iam currently working on. Workflow where iam extracting data table from email body from 30 emails and storing all the extract data table in single Excel sheet. But the problem is i need to write subject line of that particular email for every row in a separate column. Currently I’m reading all the emails and extracting dt and append the dt after extraction of all data tables from each mail. But couldn’t understand how to write subject line in separate column.

Hi @Sai_deepthi,

You can use add data column activity in UiPath to add the column once you have extracted data table from the email and pass subject line in that column for all of the rows.

Hi @Sai_deepthi

  1. Get Outlook Mail Messages

    • Output: retrievedEmails (List)
  2. Assign

    • Variable: dtCombined (DataTable)
  3. For Each

    • Input: email (MailMessage)
    • Collection: retrievedEmails
    1. Get IMAP Mail Message (or Get Exchange Mail Message)

      • Input: email (MailMessage)
    2. Assign

      • Variable: dtExtracted (DataTable)
      • Value: ExtractDataTableFromEmailBody(email.Body) // Replace with your method to extract data table
    3. Add Data Column

      • Input: dtExtracted
      • Column Name: “Subject”
    4. Assign

      • Left side: dtExtracted.Rows(0)(“Subject”)
      • Right side: email.Subject
    5. Merge Data Table

      • Source: dtExtracted
      • Destination: dtCombined
  4. Write Range

    • Input: Excel File Path
    • Input: dtCombined

Hope it helps!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.