# Filter data tables

**URL:** <https://forum.uipath.com/t/filter-data-tables/5747360>\
**Category:** Activities\
**Tags:** datatable, question, system, activities\
**Created:** [May 19, 2026, 9:13am UTC](https://forum.uipath.com/t/filter-data-tables/5747360 "2026-05-19T09:13:38Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sal23](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sal23](https://forum.uipath.com/u/Sal23)\
**Post date:** [May 19, 2026, 9:13am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/1 "2026-05-19T09:13:38Z")

</div>

How can I filter a DataTable using dynamic filters that change each time, including complex AND/OR logical conditions?

---

<div class="post-metadata">

**Author:** ![yedukondaluaregala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yedukondaluaregala/32/557780_2.png) [@yedukondaluaregala](https://forum.uipath.com/u/yedukondaluaregala)\
**Post date:** [May 19, 2026, 9:17am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/2 "2026-05-19T09:17:05Z")

</div>

@Sal23

You can use variables in the place of values section.

elaborate more about your use case

---

<div class="post-metadata">

**Author:** ![tirtheshpurohit97](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/tirtheshpurohit97/32/497833_2.png) [@tirtheshpurohit97](https://forum.uipath.com/u/tirtheshpurohit97)\
**Post date:** [May 19, 2026, 9:19am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/3 "2026-05-19T09:19:20Z")

</div>

Hi @Sal23,

You can achieve dynamic DataTable filtering using the `Select()` method or `Filter Data Table` activity by building the filter condition string dynamically at runtime.

For complex AND/OR conditions, the `Select()` method is usually more flexible.

Example:

```auto
filterCondition = "Status = 'Open' AND (Department = 'IT' OR Department = 'HR')"filteredRows = dtData.Select(filterCondition)filteredDT = filteredRows.CopyToDataTable()

```

You can dynamically build `filterCondition` using variables based on user input or configuration values.

Example dynamic build:

```auto
filterCondition = "Country = '" + countryVar + "' AND Age > " + ageVar.ToString

```

This approach works well when filters change frequently and include nested AND/OR logic.

---

<div class="post-metadata">

**Author:** ![Monali\_Vekariya](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/monali_vekariya/32/264397_2.png) [@Monali\_Vekariya](https://forum.uipath.com/u/Monali_Vekariya)\
**Post date:** [May 19, 2026, 10:52am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/4 "2026-05-19T10:52:58Z")

</div>

Hi @Sal23

You can filter a DataTable dynamically by building the filter condition as a string at runtime based on your inputs, including AND/OR logic, and then applying it using the Select() method. For more complex scenarios, you can use LINQ where you define conditions programmatically. In simple terms, you create the filter dynamically depending on user input and apply it to get the required filtered data.

---

<div class="post-metadata">

**Author:** ![Sal23](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sal23](https://forum.uipath.com/u/Sal23)\
**Post date:** [May 20, 2026, 11:46am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/5 "2026-05-20T11:46:47Z")

</div>

For now, i use a conversational agent to generate select request from the need of the user, after that, i pass the select request to a rpa workflow that will apply it inside the select  
what do you think guys about this solution ?

i added a tool to this agent to map the names of the names of the columns

---

<div class="post-metadata">

**Author:** ![yedukondaluaregala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yedukondaluaregala/32/557780_2.png) [@yedukondaluaregala](https://forum.uipath.com/u/yedukondaluaregala)\
**Post date:** [May 20, 2026, 1:29pm UTC](https://forum.uipath.com/t/filter-data-tables/5747360/6 "2026-05-20T13:29:59Z")

</div>

@Sal23

That make sense, you can get the condition filters from the user as it stored in variable and that variable passed in your workflow. and just a question why you are using conversational agent. if just getting the condition filters from the user in rpa workflow itself you can use the input dialogue box

---

<div class="post-metadata">

**Author:** ![Sal23](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sal23](https://forum.uipath.com/u/Sal23)\
**Post date:** [May 20, 2026, 3:52pm UTC](https://forum.uipath.com/t/filter-data-tables/5747360/7 "2026-05-20T15:52:49Z")

</div>

Because i’m trying to build an agent to communicate with an advisor,  
the advisor can question the agent about clients, transactions, … (excel files / history of conversations pdf files)

and the agent should be capable to answer,

i’m gonna give you examples :

the advisor needs a list of clients with conditions : client nationality is X and clients age is greater than Y  
here the agent should understand the need and do the treatment and return a response

another example can combine many files :  
the advisor want to list the data of the client who did the transaction number A,  
here the agent should combine treatment of 2 or 3 files to find the response,

this is why i’m trying to use the conversational agent,

but i’m still concerned about the architecture of my projet.

---

<div class="post-metadata">

**Author:** ![MohammedShabbir](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/mohammedshabbir/32/558335_2.png) [@MohammedShabbir](https://forum.uipath.com/u/MohammedShabbir)\
**Post date:** [May 21, 2026, 5:26am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/8 "2026-05-21T05:26:05Z")

</div>

> [@Sal23](#):
>
> Because i’m trying to build an agent to communicate with an advisor,  
> the advisor can question the agent about clients, transactions, … (excel files / history of conversations pdf files)
> 
> and the agent should be capable to answer,
> 
> i’m gonna give you examples :
> 
> the advisor needs a list of clients with conditions : client nationality is X and clients age is greater than Y  
> here the agent should understand the need and do the treatment and return a response
> 
> another example can combine many files :  
> the advisor want to list the data of the client who did the transaction number A,  
> here the agent should combine treatment of 2 or 3 files to find the response,
> 
> this is why i’m trying to use the conversational agent,
> 
> but i’m still concerned about the architec

Hi @Sal23 ,  
Your approach is good, especially keeping the conversational agent for intent understanding and query generation while RPA handles the execution.

My suggestion would be:

- Let the agent only identify intent, filters, and column mappings
- Keep joins, validations, and data processing in workflows/backend logic
- avoid giving direct execution freedom to the LLM
- keep business rules outside the model as much as possible

For multi-file scenarios, define common keys (ClientID, TransactionID, etc.) instead of letting the LLM guess relationships dynamically.

This architecture will be more scalable, reliable, and easier to maintain long term.

---

<div class="post-metadata">

**Author:** ![Sal23](https://avatars.discourse-cdn.com/v4/letter/s/838e76/32.png) [@Sal23](https://forum.uipath.com/u/Sal23)\
**Post date:** [May 21, 2026, 9:17am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/9 "2026-05-21T09:17:20Z")

</div>

in my case with many excel files with a relation between files, do you think using a database will be more efficient ?  
creating a database and tables using rpa workflows,  
after that, the agent communicate with the user, and it will generate sql requests,  
and thay will be executed using rpa workflow and recuperating the results

---

<div class="post-metadata">

**Author:** ![yedukondaluaregala](https://sea2.discourse-cdn.com/uipath/user_avatar/forum.uipath.com/yedukondaluaregala/32/557780_2.png) [@yedukondaluaregala](https://forum.uipath.com/u/yedukondaluaregala)\
**Post date:** [May 22, 2026, 6:50am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/10 "2026-05-22T06:50:17Z")

</div>

@Sal23

Till now what you are following the approach is correct to meet your business requirement, So as you mentioned there are lot files you need to handle, in that case instead of depending on the excel files you can use data base but

Do not create the table for each sheet or for 1 day files. you can a database and maintain one master table in that you can add all excel file records, and also you can add the status of that record, if incase in future if you want those you can easily get those.

Or if you dont need once processed data, store your files in central location and do the automation one by one.

If you can use database that was better approach.

Happy Automation  
YK

---

<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:** [June 3, 2026, 10:29am UTC](https://forum.uipath.com/t/filter-data-tables/5747360/11 "2026-06-03T10:29:25Z")

</div>

Closed on June 3, 2026, 10:29am UTC

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