# Filtering Data Table without looping

**URL:** <https://forum.uipath.com/t/filtering-data-table-without-looping/345572>\
**Category:** Studio\
**Tags:** tools, question, studio, excel, system, activities\
**Created:** [September 14, 2021, 7:46pm UTC](https://forum.uipath.com/t/filtering-data-table-without-looping/345572 "2021-09-14T19:46:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert\_lee1](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/robert_lee1/32/177048_2.png) [@robert\_lee1](https://forum.uipath.com/u/robert_lee1)\
**Post date:** [September 14, 2021, 7:46pm UTC](https://forum.uipath.com/t/filtering-data-table-without-looping/345572/1 "2021-09-14T19:46:10Z")

</div>

I have excel which contains 10000 records, Want to filter whether value exist in the data table or not. I am using for each row to check value but it makes my automation slow. Is there any way to filter data table without loop?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![ghazanfar](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/ghazanfar/32/175617_2.png) [@ghazanfar](https://forum.uipath.com/u/ghazanfar)\
**Post date:** [September 14, 2021, 7:47pm UTC](https://forum.uipath.com/t/filtering-data-table-without-looping/345572/2 "2021-09-14T19:47:41Z")

</div>

Hi,

Use below linq query to filter DataTable without loop.

```auto

yourDT.AsEnumerable().Any(Function(x) x("DtColumn").ToString = DesiredValue)
It will return True if any of the rows match the predicate.

```

---

<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:** [September 17, 2021, 7:47pm UTC](https://forum.uipath.com/t/filtering-data-table-without-looping/345572/3 "2021-09-17T19:47:47Z")

</div>

Closed on September 17, 2021, 7:47pm UTC

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