[HELP] Merge all unique email ids from Datatable and send 1 email to all of them using outlook

Hi Experts,

Newbie here and badly in need of help. I was able to convert my excel file with a list of employee information including email IDs into a DataTable (as DT1) but I am now stuck on how to convert that DT1 into a new DT (let say DT2) which should only contain unique email IDs (remove duplicates).

Next is, once DT2 is created. I want to send out a one email message to all IDs maintained in that DT2. (I need one single outlook email to be sent to all users. Not 1 email per user).

Thanks in advance!


You can use the DataTable activity “Remove Duplicates” to remove any duplicate rows from DT1 and store it in DT2.

Now create a EmailTo variable of String Array type.
Add all the emails to this variable and pass it as a input to the mail activity.
The parameter ‘TO’ should be an array too.

Hi @Alvin_Roy_Nemenzo

Did u need to remove duplicate rows or duplicate emails columns only ?


Thanks! Am trying to use the Remove Duplicate Rows but I can’t find an option which column should it look for duplicates. Am afraid it may remove rows from other columns aside from Email IDs


I want to remove all rows based on duplicate emails.

Scenario is: My DT1 contains more than 10 headers including Email ID

I want my DT2 to have 1 column only which is Email ID. And remove all duplicate emails (I only need the unique emails IDs).

Next is, i want to use my DT2 as my source of recipients when send 1 email for all of them. (I need one single outlook email to be sent to all users. Not 1 email per user).

In this case, just add the emails to the array and skip duplicates.
To create a new DT with only the Emails column in the DT, you can use Filter Data Table.

1 Like

Hi @Alvin_Roy_Nemenzo

After reading the excel and store in datatable varible dt1

list_1= dt1.AsEnumerable().Select(Function (row) row(“Email ID”).ToString).ToList(). Distinct ()

Where list_1 is a list

Now u can iterate through each element in list to send mail


Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

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