For Excel and Email automation

Hi
I have a data in excel file whose structure is
Emp No Emp Name Manager ID Email
E001 abc1 M001 m001@gmail.com
E002 abc2 M002 m002@gmail.com
E003 abc3 M003 m003@gmail.com
E004 abc4 M001 m001@gmail.com
E005 abc5 M001 m001@gmail.com
E006 abc6 M003 m003@gmail.com
E007 abc7 M002 m002@gmail.com
E008 abc8 M003 m003@gmail.com
E009 abc9 M001 m001@gmail.com
E010 abc10 M001 m001@gmail.com

I want send a single email to the email id of all the employees whose manger is same with full details
eg:

E001 abc1 M001
E004 abc4 M001
E005 abc5 M001
E009 abc9 M001
E010 abc10 M001
this details should be sent to m001@gmail.com
similarly to all other email ids…

1 Like

First read the excel file using read range, store it in a datatable,
Next sort the datatable according to Manager ID
Loop through the datatable and check whether the Manager ID of the current iteration is the same as the next iteration. If yes, add data row to a temporary datatable.
If not, send the datatable contents to the current Manager email.

But I am having 3-4 different email ids and want to group them according to manager ids and send email of respective employee details…

plz have a look at the sample data.

sample data.xlsx (9.5 KB)