Grouping/Filtering based on email receiver and sent to each receiver only the respective data

Dear all,
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!

Information 1 Information 2 Receiver
1992 ABC
4738 RSP
3948 SJK
1124 TEW
6593 UIE
9348 MOE
2317 PER




you can do a group by and split the groups into tables

assign activity
leftside: TableList (DataType: List(Of DataTable)
Right side:

(From d in YourDataTableVar.AsEnumerable
Group d by k=d(“Receiver”).toString.Trim into grp=Group
Select grp.CopyToDataTable).toList

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

dt2= dt1.DefaultView.ToTable(“Receiver”,True)

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

Filter condition

Receiver= row(“Receiver”).ToString

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


Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed::relaxed:

1 Like

Hi Nived,
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?

Hi @aaydin

U can check this


Nived N :robot:

Happy Automation :relaxed::relaxed:

Do I need to put the second “for each row”-loop into the first one?

Yes @aaydin