How to remove rows using filter data table with variable inside the filter data table

Hi,

I have an activity to remove a rows but based on inputted customer ID from excel. In order to do this, it need to read the excel then save it to datatable, and should the data table converted to string in order to delete it? If no, then how to delete it? Does it have to be done with looping or with a string? Here’s an example in excel :

image

@Rhys18

Have a look on this thread->

step 1 read the first table DT1
step2 read the second table DT2

for each row(dt2) activity and inside for each row use filter table
for filter table input is dt1

configure the column name and value of filtter should be row(cutomerid).tostring

1 Like

hey,
you can use merge Data table
where you can keep output of of First Data Table as DT1 and DT2 as destination of
Second Data table.
Thanks

Hi @Rhys18 ,

Could you Check the below Linq Expression :

CurrentDT.AsEnumerable.Where(Function(x)Not(DT_List.AsEnumerable.any(Function(y)y("Customer_ID").ToString.Equals(x("Customer_ID").ToString)))).CopyToDataTable

Tried it and it throw me “source contains no datarows” :

image

I even added .Trim after .ToString and it still says no datarows

Thanks for the help ! Will learn this in paralel

Thank you ! Tried this and it works

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.