# Power Table Column Drop Down Query Using configureEditor Extension Function

**URL:** <https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594>\
**Category:** Ignition\
**Created:** [September 8, 2018, 5:50pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594 "2018-09-08T17:50:09Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 8, 2018, 5:50pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/1 "2018-09-08T17:50:09Z")

</div>

How do you setup a drop down in a column and get the data for the drop down in a database table.

I see the example in configureEditor but I am not for sure on the query side of it to make it work.

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 8, 2018, 7:50pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/2 "2018-09-08T19:50:50Z")

</div>

this is what I have tried but with no luck.

```auto
if colName == 'Problem Area':
		query ="SELECT DISTINCT ['Descr'] FROM Problem WHERE Type = 'WW' and DelFlg ='0' ORDER BY Descr ASC"
		res = system.db.runQuery (query,'?')
		dlist=[]

```

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 9, 2018, 4:17pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/3 "2018-09-09T16:17:02Z")

</div>

Has any one configured the power table to do a drop down query?

---

<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:** [September 10, 2018, 3:27pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/4 "2018-09-10T15:27:06Z")

</div>

You should not run a (by comparison) slow operation like a query directly inside the configureCell function. Run the query somewhere else on the client, then in the script simply limit the results. Check this post for more information on how to do that (note that it's a fairly high-level scripting solution):

> [@Force configure cell update in power table](http://forum.inductiveautomation.com/t/force-configure-cell-update-in-power-table/16318/7):
>
> The much more efficient solution is to embed a custom editor, which will lookup the datasets dynamically whenever it’s appropriate. I’ve got a very simple example of this below; the project has an editable ‘Options’ dataset, and the available options in column B in the editable table will be dynamic based on the value in column A. The relevant code is here: root = self from javax.swing import JComboBox, DefaultCellEditor, DefaultComboBoxModel class CustomCellEditor(DefaultCellEditor):…

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 17, 2018, 1:05pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/5 "2018-09-17T13:05:13Z")

</div>

I used your example and got it to work but I can not change the data in column 2 manually. How do I get around that?

---

<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:** [September 17, 2018, 3:23pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/6 "2018-09-17T15:23:16Z")

</div>

Before the line:  
`return comp`  
add:  
`comp.setEditable(True)`

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 17, 2018, 10:56pm UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/7 "2018-09-17T22:56:51Z")

</div>

I tried it but it didn’t fix the issue. It still acts the same

---

<div class="post-metadata">

**Author:** ![jshaffer09](https://avatars.discourse-cdn.com/v4/letter/j/df788c/32.png) [@jshaffer09](https://forum.inductiveautomation.com/u/jshaffer09)\
**Post date:** [September 21, 2018, 11:27am UTC](https://forum.inductiveautomation.com/t/power-table-column-drop-down-query-using-configureeditor-extension-function/19594/8 "2018-09-21T11:27:30Z")

</div>

Is there a solution to be able to edit the column that doesn’t have the drop down?
