yhlll
July 24, 2022, 3:17pm
1
Hi,
I want to create html table and send each different row as HTML table and to send the email body/content based on each different email recipients.
eg.
To: Abc.example.com
Subject: Story
Email content:
Hi.
Refer to table below.
Title Story Start Date Closing Date Remark
Lion Animal 20 Jun22 30 Jun 22 -
The next record to send will be different as above as table will change and email recipient will change too. eg:
To: XYZ.example.com
Subject: Story
Email content:
Hi.
Refer to table below.
Title Story Start Date Closing Date Remark
Cat Cat Animal 2 Jan22 30 Apr 22 2 months
They are to read from excel file with the headers:
Title Story Start Date Closing Date Remark Email Address
So what’s the challenge you are facing here please ? @yhlll
yhlll
July 24, 2022, 10:00pm
3
The challenge is how to send to the correct email recipient based on row by row entry. What encountered issue is that it send the whole html table ( all rows) as email body to all email recipients and not individual email recipient specified in row.
So @yhlll Each row has its corresponding recipients listed ?
yhlll
July 25, 2022, 3:50pm
5
Yes, each row will have corresponding recipients.
So @yhlll
You can do the following please,
Read Range the table from the Excel
Loop the table using ForEachRow
2.1 Use Generate Data Table activity where you pass the first column content [CurrentRow(0).ToString
] as input and get the output as table
2.2 Pass the above table to DT to HTML table activity (can be downloaded from marketplace.uipath.com ) which gives you an output of HTML table code
2.3 Now use any of the Send email activity with email recipient as 2nd column value [CurrentRow(1).ToString
]
Hope this helps
Thanks
#nK
yhlll
July 26, 2022, 4:08pm
7
Hi ,
When can I download the find the DT to HTML table activity ?
That’s not an automation step, you need to download and install to build your code.
Link - Download RPA Listings - RPA Snippets, Workflows, Connectors | UiPath Marketplace
yhlll
July 27, 2022, 12:55am
9
Hi,
File is downloaded but how to import into it? Thanks.
Please go to manage packages in the Studio & Enable marketplace from which you can install the package directly.
yhlll
July 27, 2022, 4:52pm
11
Hi Nithinkrishna,
Try to find the packages in marketplace but it was not there.
yhlll
July 27, 2022, 5:25pm
13
Hi,
Manage to download the packages. To clarify the command: “ForEachRow” is this from Datatable or excel?
You will need to Read Range from Excel into a datatable and use that data table in ForEachRow
yhlll
July 28, 2022, 4:11pm
15
Hi,
The header becomes Column 1…Column2. etc. My excel header has the Headername, bit after running RPA, the header becomes Column 1…Column2. etc.
Also notice that the Start Date details is shifted forward, it split into Column 2 for the date. How to adjust to the correct holder?
Hey @yhlll
While you read the Excel are you using Add Headers option ?
Thanks
#nK
yhlll
July 28, 2022, 4:52pm
17
Hi Nithinkrishna,
It is default check for Add Headers option.
What about the Write Range ?
Hello @yhlll
If your datattable is having header row and you need to retain that while writing to excel, then enable the Add Header property in the Write Range activity.
Thanks
yhlll
July 29, 2022, 12:38pm
20
Hi Rahul,
The file is read only so using Read Rang and no Write Range.