# Power Table ConfigureCell/ConfigureEditor

**URL:** <https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251>\
**Category:** Ignition\
**Created:** [September 13, 2019, 2:47pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251 "2019-09-13T14:47:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael.walter](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@michael.walter](https://forum.inductiveautomation.com/u/michael.walter)\
**Post date:** [September 13, 2019, 2:47pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/1 "2019-09-13T14:47:42Z")

</div>

Hi Everyone,

I’m trying to make a dynamic dropdown (from sql based on another parameter on the window) in a specific column on a power table however it seems like the only way to do this is from the “configure editor” extension function. In an ideal world i’d use the configure cell function and only execute when the column index is the column i want as it allows me even more flexibility by being able to reference other cells in the row of that column to help with parsing my dropdown list of tuples. I have it working but not the way i’d like from configure editor, problem is based on the documentation configure editor only executes when the table first loads and won’t update when the data updates (aka i change my dynamic parameter on the window). Wondering if there’s a way to call an extension function on property change of the data or from another extension function or something to help with that. Also if anyone knows how to configure a list of tuples into a cell from configure cell rather than configure editor that would be my ideal scenario. Below is code from my ConfigureEditor that works but does not update when the data updates:

```
def pds_to_tuples(pds):
	return map(lambda r: tuple([c for c in r]), pds)

cell = self.parent.getComponent('MES Object Selector').equipmentItemPath
if cell == system.tag.read('[client]Client Equipment Path').value:
	cell = system.tag.read('[client]Client Equipment Path').value + "\Filler"
#print cell

AlarmData = system.db.runPrepQuery("Select AlarmID, AlarmDescription From MES_Alarm_Lookup where equipmentUUID = ? and SecondaryAlarm = 1 order by AlarmID asc",[cell],system.tag.read("[System]Client/System/DefaultDatabase").value)
if colName == 'Alarm Description' and cell != "":
	return {'options':pds_to_tuples(AlarmData)}
```

---

<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 13, 2019, 3:14pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/2 "2019-09-13T15:14:10Z")

</div>

@michael.walter, I moved this post out to a new thread.

I would encourage taking a look at my post in another thread, solving essentially the problem you're describing:

> [@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):…

Note that, as @pturmel (correctly) likes to point out, you would _not_ want to do something blocking like `system.db.runPrepQuery` directly in a frontend call - those scripts block the event dispatch thread, meaning your client will hang up entirely if that query ever returns slowly.

---

<div class="post-metadata">

**Author:** ![michael.walter](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@michael.walter](https://forum.inductiveautomation.com/u/michael.walter)\
**Post date:** [September 13, 2019, 3:27pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/3 "2019-09-13T15:27:34Z")

</div>

what exactly do you mean by a frontend call. pardon my ignorance. and how would i do that on the backend then but still be able to use it in an extension function

---

<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 13, 2019, 3:28pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/4 "2019-09-13T15:28:51Z")

</div>

Basically, just let us do it for you. If you move your query to a query binding on a dataset property, we’ll manage the polling and do it asynchronously. Then in your script, you just refer to that custom property, which is “safe” - since it won’t directly run the query, just refer to whatever value the custom property has at that moment.

---

<div class="post-metadata">

**Author:** ![michael.walter](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@michael.walter](https://forum.inductiveautomation.com/u/michael.walter)\
**Post date:** [September 13, 2019, 3:29pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/5 "2019-09-13T15:29:23Z")

</div>

ok gotcha. make sense thanks

---

<div class="post-metadata">

**Author:** ![michael.walter](https://avatars.discourse-cdn.com/v4/letter/m/919ad9/32.png) [@michael.walter](https://forum.inductiveautomation.com/u/michael.walter)\
**Post date:** [September 13, 2019, 5:18pm UTC](https://forum.inductiveautomation.com/t/power-table-configurecell-configureeditor/28251/6 "2019-09-13T17:18:43Z")

</div>

based on your script i got mine working other than the fact that what i really want is it to be a tupple for the dropdown that only shows the second column in the dropdown but has a value associated with it. right now its literally listing out my tupple in the dropdown. is there any way to make it as i just described? ![powertabletupple](https://us1.discourse-cdn.com/inductiveautomation/original/2X/5/5de99f06ab519dbc2e42e7fa785d40f2e932727b.jpeg)
