# Power Table Drop Down List - Named Query

**URL:** <https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811>\
**Category:** Ignition\
**Created:** [June 15, 2021, 9:10pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811 "2021-06-15T21:10:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![martin.krehlik](https://avatars.discourse-cdn.com/v4/letter/m/8baadc/32.png) [@martin.krehlik](https://forum.inductiveautomation.com/u/martin.krehlik)\
**Post date:** [June 15, 2021, 9:10pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/1 "2021-06-15T21:10:53Z")

</div>

Hi,

I need to add drop down list to power table cell. I have added following code to ConfigureEditor extension function.  
None drop down list is displayed when I select ‘Work\_Centre’ column. Could you help me to find the problem.

```auto
if colName == 'Work_Centre':
	query = system.db.runNamedQuery("WorkCentres_NotAll", {})
	RoleList = []
	for row in query:
                thisList = []
		for item in row:
			thisList.append(item)
			RoleList.append(thisList)		
		return {'options': RoleList}

```

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [June 16, 2021, 2:00pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/2 "2021-06-16T14:00:48Z")

</div>

Welcome to the forum! Quick tip – if you put three backticks (`) before and after your code, all the formatting will be preserved and it will be much easier for everyone to read. I took the liberty of adding that for you.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [June 16, 2021, 3:44pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/3 "2021-06-16T15:44:27Z")

</div>

Is your code indented correctly here on the forum? Your `return` statement is too deep, it should be at the same level as the first `for`.

Also, **do not run queries in the configureEditor or configureCell** functions. They run on the event dispatch thread, so any slowdown from your query will lead to terrible client performance. Use a custom property to bring in the values from that named query, and simply reference it in the extension function - that way the query is automatically run asynchronously.

---

<div class="post-metadata">

**Author:** ![hazey](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@hazey](https://forum.inductiveautomation.com/u/hazey)\
**Post date:** [April 6, 2022, 4:46am UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/4 "2022-04-06T04:46:15Z")

</div>

@paul-griffith how do we reference a custom property in the configureEditor extension function please?

thanks Hazey

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [April 6, 2022, 11:25am UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/5 "2022-04-06T11:25:48Z")

</div>

Depends on where the custom property is at.

If the custom property is on the Power Table Component then:

```python
self.customPropertyName

```

If the custom property is on the parent of the Power Table Component then:

```python
self.parent.customPropertyName

```

Honestly though, just use the property selector in the top right corner of the component scripting dialog to choose the property that you want, it will take care of building the correct reference path for you.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/7/773f70627f71902dd62440e10c564ff92d43f617.png)

---

<div class="post-metadata">

**Author:** ![hazey](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@hazey](https://forum.inductiveautomation.com/u/hazey)\
**Post date:** [April 6, 2022, 7:29pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/6 "2022-04-06T19:29:49Z")

</div>

Irose thanks, but I do not have those selectors on right hand side, version 8.1.10?

---

<div class="post-metadata">

**Author:** ![hazey](https://avatars.discourse-cdn.com/v4/letter/h/a587f6/32.png) [@hazey](https://forum.inductiveautomation.com/u/hazey)\
**Post date:** [April 6, 2022, 7:34pm UTC](https://forum.inductiveautomation.com/t/power-table-drop-down-list-named-query/47811/7 "2022-04-06T19:34:00Z")

</div>

OK I see it is .13 it was added:)
