Data table filtering technique

I have an excel with almost 17thousand rows. My doubt is, when I get it in a data table & try to filter it using for each, does it take a lot of time to process it? I just want to keep the rows where one column says approved.

Hi @Praj01
By using For each it takes more time,Try using Linq queries

1 Like

Hi @Praj01

Since the data set is a bit large, you can consider the possibility of using LinQ query instead of For Each row. Please try this query in an Assign activity:

yourDt = yourDt.AsEnumerable.Where(Function(row) row(“yourColumnName”).ToString.ToLower.Equals.(“aproved”)).CopyToDataTable

This will return you the data table which only contains the approved rows.

Hope this helps,
Best Regards.

1 Like

dtResult =

YourDataTableVar.AsEnumerable().Where(Function (x) x(YourColNameOrIndex).toString().ToUpper().Equals("ABC")).CopyToDataTable

[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum

:ambulance: :sos: [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum

1 Like

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