Hi,
I have two excels, I want to share table through email.
Attaching excels along with email format
student.xlsx (9.2 KB)
clg.xlsx (8.8 KB)
Read the excel files with Read range activity and use below solution to send the datatable through email body.
Thanks,
Ashok
Hi @sshitol
To share tables from two Excel files through email in UiPath, you can follow the steps below. This includes reading the data from the Excel files, formatting the data into an HTML table, and then sending it via email.
Steps to Send Tables from Two Excel Files via Email in UiPath:
-
Read Data from Excel Files:
Use the Excel Application Scope activity to open each Excel file.
Use the Read Range activity to read the data from the specific sheets or ranges into DataTable variables. -
Convert DataTables to HTML Tables:
Convert the data in each DataTable to an HTML table format. This can be done using custom code or by manually concatenating strings to form the HTML structure.
You can include this code in an Invoke Code activity or use a simple string manipulation if the DataTables are small. -
Prepare the Email Body:
Create the email body in HTML format, incorporating the HTML tables you created from the DataTables. -
Send the Email:
Use the Send SMTP Mail Message or Send Outlook Mail Message activity to send the email.
Configure the properties as follows:
To: The recipient’s email address.
Subject: Subject of the email.
Body: The HTML content prepared above.
IsBodyHtml: Set this to True to enable HTML formatting in the email.
Attachments: Optionally, attach the original Excel files using the Attachments property if needed.
Thanks,
Purushotham
i tried its working but allignment is not proper… headers coming in center while other rows are coming left