Copy Excel Cells Data to Outlook Body

Hi All,
I want to copy cells from an excel (Ex: A1:B5) and paste it in table format similar to the excel data in Outlook mail body. Kindly refer the image below.
exceldata

I have copied all the entries and tried pasting in the mail body as html, but it is pasting as a plain text i.e., in a single row. Please suggest me a solution :slight_smile:

1 Like

I believe you would need to use the <tr> tag for a new row and <td> tag for each cell value.
Essentially, you would want to use Output Data Table to get a comma delimited string, then replace the commas with the td tags and newlines with the tr tags.

If you want a simple solution, you could try out the “Table to HTML” custom activity by vvaiday found in the Community Feed. https://gallery.uipath.com/api/v2

2 Likes

@ClaytonM Thanks for your kind suggestion. :bouquet:

Ideally I’m not using a data table in my activity. I’m exporting this excel from SAP and then copying the entries by sending the hotkeys (Ctrl+Shift+Right, Ctrl+Shift+Down, Ctrl+C). Could you please send me a sample workflow for this scenario if possible?

Please let me know in case of further information required… :slight_smile:

Hi.

I suggest you use the Export feature in SAP (I’m assuming you are using SAP GUI application).
When you export the data, you can export it to a spreadsheet directly to a file. After that, you can simply use like Read CSV or Excel Read Range and store the data to a DataTable type variable.

Sorry, I don’t really have a sample on me to represent this, but hopefully it’s straightforward.

Regards.

1 Like

Hi @PAVITHRAN,
I have created the sample workflow to embed the Data table in mail Body .
Please find the attached workflow and let me if that resolves your issue.Datatable in Mail.xaml (12.3 KB)
Also find the attached mail output.MailBodyOutput

3 Likes

Hi Chetan,
So glad to see your response :blush:. Appreciate your kind help.
I have executed your workflow with my excel but still I’m getting the mail body in plain text format. Please refer below screenshot.

I have attached a sample excel sheet. Please try with your workflow and let me know the result. Meanwhile I’ll also try from my part. :slight_smile:sample.xlsx.xlsx (10.6 KB)

Hi @PAVITHRAN,
I am able to get it through my workflow.
MialBodyUpdated
Make sure u update the “str1” varible as:
“”“+row.item(“Sales Document”).toString.trim+”“+row.item(“Purchase order no.”).toString.trim+”“”
also check the “IsBodyHtml” property of mail activity.

2 Likes

Hi Chetan,
Thanks for your great help :bouquet:. Think we have restrictions to our Client Outlook, so that few features were disabled. We have encountered this in the past like some of the user DLs’ were restricted to send from local network. No issues now :slight_smile:, I somehow managed to paste the data in MS_Paint and saved that as an image and attached to the body of my mail. (Though it’s not a right approach :stuck_out_tongue_winking_eye: )

Thanks for your valuable suggestion once again, learnt a new thing :clap:. Kudos!!! :beers:

@ClaytonM Thanks for your suggestion too :relaxed:. I Appreciate it :clap:

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