# Refreshing a dropdown in a power table?

**URL:** <https://forum.inductiveautomation.com/t/refreshing-a-dropdown-in-a-power-table/71385>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [March 21, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/refreshing-a-dropdown-in-a-power-table/71385 "2023-03-21T15:18:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [March 21, 2023, 3:18pm UTC](https://forum.inductiveautomation.com/t/refreshing-a-dropdown-in-a-power-table/71385/1 "2023-03-21T15:18:11Z")

</div>

Using 8.1.17 vision.

I have a power table with

```auto
	if colName == 'Location':
		locationNames = system.dataset.toPyDataSet(self.parent.parent.locationChoices)
		options = []
		for (idx, name) in locationNames:
			options.append((name, name))
		return {'options': options}

```

in the configureCell extension function to make a dropdown, where `self.parent.parent.locationChoices` is a dataset custom property that is a named query using caching.

On the same window is an ability to add a location choice. The script looks like

```auto
addedOfficeLocation= event.source.parent.getComponent('name').text
system.db.runNamedQuery('forms/VendorPurchaseOrder/form/addOfficeLocation', {'name':addedOfficeLocation})
# this is the NQ that populates the dropdown
system.db.clearNamedQueryCache('forms/VendorPurchaseOrder/form/ddOfficeLocations')
system.db.refresh(event.source.parent.parent, 'locationChoices')

```

However, adding a new location and then clicking the cell in the table that shows the dropdown does not update anything.

I did a little testing and found that if I make a `listLocations` property on the power table itself and refer to that instead in the configureCell extension like

```auto
	if colName == 'Location':
		locationNames = system.dataset.toPyDataSet(self.locationChoices)

```

Then this does work but only in designer in preview mode, for some reason in the client I have the same issue - adding a new location does not appear in the dropdown unless I exit and then re-open the window.

I also tried be calling the NQ directly in the configureEditor but same issues as before.

It seems like having a custom property on the power table itself which is just referring to my root container dataset is the only way that _sort_ of works - again only in designer.

Is this a bug? Is there a way to accomplish what I am trying to do?

---

<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:** [March 21, 2023, 3:56pm UTC](https://forum.inductiveautomation.com/t/refreshing-a-dropdown-in-a-power-table/71385/2 "2023-03-21T15:56:18Z")

</div>

This code should still work fine:

> [@Force configure cell update in power table](https://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):…
