# Data table filtering technique

**URL:** <https://forum.uipath.com/t/data-table-filtering-technique/559368>\
**Category:** Studio\
**Tags:** system, activities\
**Created:** [June 30, 2023, 12:02pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368 "2023-06-30T12:02:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Praj01](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/praj01/32/407094_2.png) [@Praj01](https://forum.uipath.com/u/Praj01)\
**Post date:** [June 30, 2023, 12:02pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368/1 "2023-06-30T12:02:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![lrtetala](https://avatars.discourse-cdn.com/v4/letter/l/e19b73/32.png) [@lrtetala](https://forum.uipath.com/u/lrtetala)\
**Post date:** [June 30, 2023, 12:04pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368/2 "2023-06-30T12:04:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![arjunshenoy](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/arjunshenoy/32/404588_2.png) [@arjunshenoy](https://forum.uipath.com/u/arjunshenoy)\
**Post date:** [June 30, 2023, 12:05pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368/3 "2023-06-30T12:05:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ppr](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ppr/32/464097_2.png) [@ppr](https://forum.uipath.com/u/ppr)\
**Post date:** [June 30, 2023, 12:06pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368/4 "2023-06-30T12:06:31Z")

</div>

> **[Four Ways to Filter Data Tables in UiPath Studio | UiPath](https://www.uipath.com/community-blog/tutorials/four-ways-to-filter-data-table-in-uipath-studio)**
>
> Discover how working with data tables are an important part of automation. Learn some cool, handy activities for filtering data tables on UiPath Studio.

dtResult =

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

```

[[HowTo] LINQ (VB.Net) Learning Catalogue - Help / Something Else - UiPath Community Forum](https://forum.uipath.com/t/howto-linq-vb-net-learning-catalogue/325671)

[🚑 🆘 [FirstAid] Handling of The source contains no DataRows exception - News / Tutorials - UiPath Community Forum](https://forum.uipath.com/t/firstaid-handling-of-the-source-contains-no-datarows-exception/410526)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/system/32/182466_2.png) [@system](https://forum.uipath.com/u/system)\
**Post date:** [July 3, 2023, 12:06pm UTC](https://forum.uipath.com/t/data-table-filtering-technique/559368/5 "2023-07-03T12:06:35Z")

</div>

Closed on July 3, 2023, 12:06pm UTC

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