Tutorial in using Select?

Hi, are there any guides or tutorial in using select? I want to filter a data table using several criteria, and I’m unable to find much resources, and using Filter Data Table has not produced the results I’m after.

What I want is to filter a data table, let’s call it DT. I have four variables, and I want to filter rows where the value in ColA is in Var1 AND the value in ColB is in Var2, or the value in ColC is in Var3.

Any input on how to solve this or links to a tutorial where I can learn the magic that is Select?


You can try this one

If you need OR condition in place of And … You can also change it

1 Like

Hi
welcome to uipath community
awesome @Sweety_Girl thats a good point
in addition to that
with select method it would be like this
yourdatatable = yourdatatable.Select(“[columnname1] = ’ " +variable1.ToString+ " ’ AND [columnnam2] = ’ " +variable2.ToString+ " ’ AND [columnname3] = ’ " +variable3.ToString+ " '”).CopyToDatatable()

Cheers @mickeymack

1 Like

Hi - thanks for your help. Will this keep or drop the rows that match the condition? I’d like to drop the ones that match.

Then select the Rows filtering mode to remove
image

1 Like

select method will usually keep the records if the conditiion is mentioned as =
or it will neglect if the conditiion is mentioned as <>
its all based on the condition been set

while in filter datatable activity the default option KEEP will be chosen while if we want to remove the matching rows then we can select the REMOVE radio button in the filter wizard
image

Cheers @mickeymack

1 Like

Ok, many thanks. I will try that.

1 Like

Hi again. It seems that filter data table won’t accept strings with multiple conditions.

This is my data structure (sample - can’t upload file because I’m a new user)
image
image of my filter data table to follow in another post (because new user…)
Currently it’s not filtering anything. What I want is that if row matches one of the values in the strings, it should be removed (one in ColA + one in ColB etc.).

and this is my filter data table activity: