Derive values from one datatable based on inputs from a second datatable


#1

Hi,
I have a 2 datatables DT1 and DT2. DT1 has the first name and last name and DT2 has first name, last name , employee email id, Manager, name and Manager email id. I need to get the employee email id, manager name and manager email id from DT2 based on the first name and last name from DT1. How do i do this?
VP


#2

You can use filter Datatable activity where you can pass the first name and last name from DT1 instead of hardcoding it.

and in the output columns pass all the column name that you want to extract.

In the output, you will have a datatable with one row which meets the condition

You can find more details on Filter datatable in the below link

Bharat


#3

You can use LINQ to filter the Datatable DT2 using firtName and Lastname from DT1, to get the datarow from DT2. You can obtain other information from this dataRow.

dtRow = DT2.AsEnumerable.Where(function(x) x(“firstName”).ToString = strFirstName and
x(“lastName”).ToString = strLastName)(0)