I am struggling in creating a robot which sends emails with information based on the receiver email address in a Excel table.
Each receiver needs to get only one email with his/her information.
Thank you very much in advance!
you can do a group by and split the groups into tables
leftside: TableList (DataType: List(Of DataTable)
(From d in YourDataTableVar.AsEnumerable
Group d by k=d(“Receiver”).toString.Trim into grp=Group
in a second step us a for each (TypeArgument: DataTable) and iterate over the different group datatables e.g. for sending the different emails
Acces the group key (in your case the email id) with grp(0)(YourKeyColNameOrIndex).toString:
find starter help here:
SplitToTableList_1Col.xaml (7.2 KB)
First read the excel file and store in dt1
Then use assign activitiy as
This will contains dt2 with only unique reciever names.
Us for each row to loop through each recover value in DT2
Inside it do the following:
Use filter datatable activity to filter Accordingly
Input Datatable: dt1
Output Datatable: dt3
Now the output of filter datatable activity is dt3.
Now after this use for each row to loop through dt3
Since u need to.embeded the each row data in body of email.
You can use HTML.part and embedded the required values.
And after doing that use send mail activitiy to send the mail ( after exiting from for each row of dt3)
Hope the above idea helps you
thank you very much.
How can I embeded the table into the emails?
Do I need to create a data table and add the rows in this table?
Do I need to put the second “for each row”-loop into the first one?