I have two excel files. One file has name of all the employees in the company and another excel file has the name of the employees who filled out the survey. I need to send out the email to the employees who did not fill out the survey. Below are the files:
Excel1 (this has the name of the employee in the company)
Employee Name email
ABC ABC@test.com
DEF DEF@text.com
XLD XLD@est.com
PQR PQR@text.com
HJD HJD@test.com
Excel2 ( name of the employees who filled out the survey)
PQR
XLD
ABC
I want to send an email to employees “DEF”, “HJD”. Is it possible to do this task through UI path. Both the excel spreadsheet are ready.
Take Read range workbook activity, and pass your first excel file path and sheet and create output variable as dt1
Take Another Read range workbook activity, and pass your second excel file path and sheet and create output variable as dt2
Take assign activity, create a data table variable(dtPendingEmails) and pass that variable in To section and in value section New DataTable() this is initializing the variable to avoid the null exceptions
Take another assign activity, pass above created variable(dtPendingEmails) in To section and in value section enter the below expression, dt1.AsEnumerable().Where(Function(x) Not dt2.AsEnumerable().Any(Function(y) y(“Name”).ToString() = x(“Name”).ToString())).CopyToDataTable()
Take for each row in datatable activity, pass dtPendingEmails variable in Data Table section
Take Send outlook mail message activity in that pass CurrentRow(“email”).ToString in To section accordingly enter your subject and body.