Issue with exporting email body to excel

Hello all,

I’m having a trouble exporting gmail body text to excel. The other cells Date & Subject are fine.
I’m attached the except export, IMAP settings, and flow video.

Thanks in advance!
2020-11-28 08-25-36|video

Hi @Austin_Hunter
The ‘Add Data Row’ activity input is not clear from the video.
Can you please show how the ‘body’ is being added to the table?

I put {mail.Headers(“Date”),mail.Subject,mail.Body} as the ArrayRow and the dtOutput as the DataTable. I’ve got it to work before with this configuration. I’ve also tried mail.Body.ToString. :grimacing:

Can you try Write Line or Log Message to print mail.Body and see what you get?
Better yet, put a breakpoint on Add Data Row activity, and see what’s going in at the time of execution by inspecting the MailMessage object (mail)

What info can I get from the breakpoint? I’m not sure if I’m setting up the log messages correctly, all I’ve got from it is more text than what was exported to the excel. The log is attached. I got the same thing in the log as I did with the write line activity.
I’m also not sure how to check what is happening at the time of execution within MailMessage object.

outputlog.txt (19.8 KB)

New Microsoft Excel Worksheet.xlsx (13.6 KB)

The UiPath Docs for Debugging are an excellent resource for a quick start. (Also Academy training is quite detailed and thorough)
Check this page out to see how you can use breakpoints to effectively “pause” the running workflow and see a snapshot of that instance, value of each variable before the paused activity executes.

(Traverse the menu tree on the left to read about other panels in the Debugging section)

Also, the mail body looks right. This is what you can expect when you read mail.Body as String because it invariably contains HTML.
There are a few good topics on forums about how to make sense of the HTML string you receive from the Body property.

  1. Getting HTML Mail Body - #7 by Bharat_Kumar
  2. Get outlook mail messages html body - #2 by nimin

See if one of the solutions discussed here work for you. Essentially what you need to do is get rid of all the HTML tags sitting between <> and </> And a few other non-textual residue after clean up.
The topics above have some insights into doing that.
Please let us know on your progress and any issues you encounter :slight_smile: