# How to filter dataset value using drop-down

**URL:** <https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903>\
**Category:** Ignition\
**Created:** [July 4, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903 "2023-07-04T17:41:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amol\_Kale](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Amol\_Kale](https://forum.inductiveautomation.com/u/Amol_Kale)\
**Post date:** [July 4, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903/1 "2023-07-04T17:41:09Z")

</div>

I am working on a project in which I want to populate the data into the table using drop-down selected value.  
I have created dataset in session property and this property is binded to the table.  
In the drop-down there are three values  
Value1, value 2 and All.  
When I select the Value 1 in drop-down, table should show only the value1 data in the table, When I select value2 table must show data for value2 only and when I select All option in drop-down, the for all values should be populate into the table .

The drop-down and the table both are in different view.  
If is there any way to do this help is appreciated.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 4, 2023, 5:48pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903/2 "2023-07-04T17:48:48Z")

</div>

- Create a session variable `ddSelection`.
- Create a property binding on the dropdown `props.value` to the session variable. Set it to bidirectional.
- Bind your table query filter to the session variable.

This is a handy feature of session variables - they can act like globally scoped variables.

---

<div class="post-metadata">

**Author:** ![Amol\_Kale](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@Amol\_Kale](https://forum.inductiveautomation.com/u/Amol_Kale)\
**Post date:** [July 4, 2023, 5:52pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903/3 "2023-07-04T17:52:43Z")

</div>

We have created dataset in session property. We are not using query binding

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [July 4, 2023, 5:55pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903/4 "2023-07-04T17:55:12Z")

</div>

Add a script transform to your dataset binding and use the session variable in the binding to filter the data.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [July 4, 2023, 5:55pm UTC](https://forum.inductiveautomation.com/t/how-to-filter-dataset-value-using-drop-down/75903/5 "2023-07-04T17:55:53Z")

</div>

I don't think he's fetching the data from a database here.

@Amol_Kale  
Begin as @Transistor said: Create a session custom property and bind your dropdown's `value` prop to it.  
Making it bidirectional will ensure that the session prop is updated when the dropdown's value changes.  
On your table, use a structure binding with 2 elements: One to the dataset, the other one to the session custom prop holding the filter.  
Add a script transform and filter your dataset there.

If you need help with the transform, I'll need more details about the dataset and the filters.
