# How to use Multi-Select Dropdown and filter the Power Table

**URL:** <https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 15, 2024, 4:56am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260 "2024-01-15T04:56:27Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthew\_Lam](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Matthew\_Lam](https://forum.inductiveautomation.com/u/Matthew_Lam)\
**Post date:** [January 15, 2024, 4:56am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/1 "2024-01-15T04:56:27Z")

</div>

Hi, I am trying to use the new function Multi-Select dropdown to display different values in my power table based on the selections in the dropdown. The problem is I cannot directly access a dataset object (selectedLabels) in my Power table SQL query. How can i do this?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 15, 2024, 5:10am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/2 "2024-01-15T05:10:51Z")

</div>

I probably need more details, but my guess is that you should pull in the unfiltered SQL data you want to the data property of the multiselect dropdown, and then directly bind your power table's data property to multiselect dropdown's selectedData property.

This way, the user selections will automatically populate the power table with the selected data, and there will be no need for subsequent queries.

---

<div class="post-metadata">

**Author:** ![Matthew\_Lam](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Matthew\_Lam](https://forum.inductiveautomation.com/u/Matthew_Lam)\
**Post date:** [January 15, 2024, 11:27pm UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/3 "2024-01-15T23:27:45Z")

</div>

Hi, Basically what i am trying to do is filter the power table here using the multi dropdown option. I am hoping i can access the selectedLabels datasety object into the SQL query for my table. So something like this.  
-- First try to create a list from my multiselect function  
with t as (SELECT \* FROM '{Root Container.Container.MultiSelectDropdown.selectedLabels}["selectedLabels"]')  
-- Then filter my table based on the multiselect function  
SELECT\*  
FROM KoroitSamples  
WHERE KoroitSamples.[Instrument] in t  
But this does not work, thus i am trying to find an option where i can access the dataset object in SQL.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/2/b2f1e1e2c9df2802a50d5d84e9c431219fc9cb2b.png)

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 16, 2024, 1:01am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/4 "2024-01-16T01:01:12Z")

</div>

Sounds like you want something like the Pseudo-SQL offered by my [view()](https://www.automation-pros.com/toolkit/doc/scripting.html#view) expression function (part of my free [Integration Toolkit](https://inductiveautomation.com/moduleshowcase/module/automation-professionals-llc-integration-toolkit) module).

Or, for more focused tasks, perhaps directly use the [where()](https://www.automation-pros.com/toolkit/doc/iteration.html#where) expression function.

---

<div class="post-metadata">

**Author:** ![Matthew\_Lam](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Matthew\_Lam](https://forum.inductiveautomation.com/u/Matthew_Lam)\
**Post date:** [January 16, 2024, 1:37am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/5 "2024-01-16T01:37:18Z")

</div>

Hi, thank you for replying, Can you clarify? Is view() and where(), used in expression only? Can i use them in SQL query? How would i use where() for the above scenario?

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 16, 2024, 2:27am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/6 "2024-01-16T02:27:03Z")

</div>

I'm off tomorrow, so if you haven't figured this out by then, I'll set something up in my test environment to demonstrate a few ways to do this.

> [@Matthew\_Lam](#):
>
> {Root Container.Container.MultiSelectDropdown.selectedLabels}

I imagine that you will need to get the column as a list to make it useful for querying, which means you would have to script the query on the `selectedLabels` propertyChange event.

The script would look something like this:

```auto
'''
Written for the script editor of the multiselect dropdown's propertyChange event handler
'''

# If and only if the selectedLabels property of the multiselect dropdown changes
if event.propertyName == 'selectedLabels':
	
	# Get the labels as a list
	labels = event.source.selectedLabels.getColumnAsList(0)
	
	# Create a parameterized query query and match the number of parameters to the number of labels
	query = "SELECT * FROM KoroitSamples WHERE KoroitSamples.[Instrument] IN (%s)" % ', '.join('?' for item in labels)
		
	database = #The database name will need to be defined
	
	# Run the query and assign its result to the data property of the power table
	# Change this path to the relative path of the power table
	event.source.parent.getComponent('Power Table').data = system.db.runPrepQuery(query, labels, database)

```

That script looks proper by my eyes, but full disclosure: I'm not where I can test code at the moment.

---

<div class="post-metadata">

**Author:** ![Matthew\_Lam](https://avatars.discourse-cdn.com/v4/letter/m/4491bb/32.png) [@Matthew\_Lam](https://forum.inductiveautomation.com/u/Matthew_Lam)\
**Post date:** [January 16, 2024, 3:12am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/7 "2024-01-16T03:12:51Z")

</div>

thank you so much it worked.

---

<div class="post-metadata">

**Author:** ![saurabh1](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@saurabh1](https://forum.inductiveautomation.com/u/saurabh1)\
**Post date:** [November 25, 2025, 11:16am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/8 "2025-11-25T11:16:45Z")

</div>

Hi team, Just to extend I need to extract data property of Template and bind it from my tag which i need to filter.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [November 27, 2025, 12:47am UTC](https://forum.inductiveautomation.com/t/how-to-use-multi-select-dropdown-and-filter-the-power-table/84260/9 "2025-11-27T00:47:14Z")

</div>

> [@saurabh1](#):
>
> I need to extract data property

Is this a question?
