# Need to filter a DB Table with a session property

**URL:** <https://forum.inductiveautomation.com/t/need-to-filter-a-db-table-with-a-session-property/78724>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [September 4, 2023, 3:15pm UTC](https://forum.inductiveautomation.com/t/need-to-filter-a-db-table-with-a-session-property/78724 "2023-09-04T15:15:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacopo\_Gennari](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jacopo\_Gennari](https://forum.inductiveautomation.com/u/Jacopo_Gennari)\
**Post date:** [September 4, 2023, 3:15pm UTC](https://forum.inductiveautomation.com/t/need-to-filter-a-db-table-with-a-session-property/78724/1 "2023-09-04T15:15:33Z")

</div>

Hi everyone.

I have a table on a DB I need to traspose on an Ignition Table, but I need to filter it by just selecting the rows where the value of the "FullPlantName" column match the "SelectedPlant" session property.

Is there a way to make queries and session property interact somehow? Or is there any way I could work around it?

---

<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:** [September 4, 2023, 3:28pm UTC](https://forum.inductiveautomation.com/t/need-to-filter-a-db-table-with-a-session-property/78724/2 "2023-09-04T15:28:36Z")

</div>

1. In Project Properties set the default database to whichever one you want.
2. Create a new Named Query (at the bottom of the Project Browser tree).
3. Add a `SelectedPlant` parameter of appropriate type to the named query. Use this in your query using syntax `:SelectedPlant`.

The query should look something like,

```auto
SELECT *
FROM myDataBase
WHERE FullPlantName = :SelectedPlant
ORDER BY <name of field>

```

1. Create a binding on the table's `PROPS.data`. Select Query binding, select the named query and point the parameter at your session property.

---

<div class="post-metadata">

**Author:** ![Jacopo\_Gennari](https://avatars.discourse-cdn.com/v4/letter/j/e68b1a/32.png) [@Jacopo\_Gennari](https://forum.inductiveautomation.com/u/Jacopo_Gennari)\
**Post date:** [September 19, 2023, 8:34am UTC](https://forum.inductiveautomation.com/t/need-to-filter-a-db-table-with-a-session-property/78724/3 "2023-09-19T08:34:24Z")

</div>

Hi! sorry for my late answer. it Worked!! Thank you!
