I have an excel file that i read with Read Range Workbook into a data table.
Then i want to keep only just a few columns so after creating another data table (Build Data Table activity) i use For each row in data table and Add Data row activities. All good so far.
The columns are Invoice and Email and the goal is to search in the data table via the invoice and retrieve the email. If the provided email exists then i get alot of results back, if it doesnt exist then i get an empty datarow().
this is a expected behavior. If there are multiple rows with same Invoice number then you will get multiple rows, if there is no matching row (based on Invoice number) then you will get zero rows i.e. empty datarow()
It will be better if can explain the issue in more detail.
arrMatchedRows = dt_input.AsEnumerable().
Where(Function(f) f(“Invoice”) IsNot Nothing AndAlso
f(“Invoice”).ToString.Trim.Equals(“123456789”, StringComparison.OrdinalIgnoreCase)).
ToArray()
Try these linq query or also you can use filter datatable activity
first for filter you can use as suggest by @postwick or use dt = dt.DefaultView.ToTable({"Col1","Col2"},False) in assign this retains only those columns you give
now coming to other filters…check contains or use trim may be extra spaces are there