Filter datatable dynamically using DataTable.AsEnumerable()

we can do following:

Assign Activity
arrFilterNames | String( ) -string Array
= {“John”,“James”}

Assign Activity:
dtFiltered =

(From d in YourDataTableVar.AsEnumerable
Let check = arrFilterNames.Any(Function (x) d("First Name").ToString.toUpper.Trim.Equals(x.ToUpper))
Where check
Select r=d).CopyToDataTable

When also empty results are to expect we can handle as described here:
:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

1 Like