Need help to send one email with multiple names identified in excel

Employee name RO Name RO email Renew License?
Person 1 Person A abc.outlook.com.sg Yes
Person 2 Person B zxc.outlook.com.sg No
Person 3 Person A abc.outlook.com.sg Yes
Person 4 Person A abc.outlook.com.sg No
Person 5 Person B zxc.outlook.com.sg Yes

I have an excel file like the table above which contains a list of people, their RO’s name and email and indication if the person’s license have expired. So, if the person’s license has expired, the automation needs to send an email to the person’s reporting officer. Instead of sending one email at a time, I would like the automation to identify all the people whose license has expired and send to the RO in one email. For example, Person A should receive an email with person 1 and 3 names in one email.

I am using studio x to make the automation

@Matthew_Khoo

Welcome to the community

First read data into datatable use filter datatable to filter for the required status

Now create a variable of type array fo string and use assign or set variable with variable on left and on right use filtereddt.AsEnumerable.Select(function(x) x("RO Email").ToString).Distinct().ToArray this will give all unique ro emails which have status of yes

Now use for loop on the array

Inside array use filter datatable with filter as currentitem which is the email on the email column and save to different datatable..so the output would contain only rows belonging to the manager email id and license as yes..so you have all in one table

For each iteration you would have different manager related set of datatable..

Cheers

Thank you Anil_G but would you be able to show how can I create this as I am very new to studio x so I am unfamiliar with it