# Adding Dropdown box into PowerTable

**URL:** <https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188>\
**Category:** Ignition\
**Created:** [February 10, 2016, 2:50pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188 "2016-02-10T14:50:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![mikehill100](https://avatars.discourse-cdn.com/v4/letter/m/bcef8e/32.png) [@mikehill100](https://forum.inductiveautomation.com/u/mikehill100)\
**Post date:** [February 10, 2016, 2:50pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/1 "2016-02-10T14:50:17Z")

</div>

I found how to do it it in a regular table here:

[inductiveautomation.com/forum/v … umn#p24546](https://inductiveautomation.com/forum/viewtopic.php?f=70&t=7840&p=24546&hilit=dropdown+in+a+table+column#p24546)

Does anyone know how to do this with a powertable?

Thanks!

- Mike

---

<div class="post-metadata">

**Author:** ![JGJohnson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jgjohnson/32/29582_2.png) [@JGJohnson](https://forum.inductiveautomation.com/u/JGJohnson)\
**Post date:** [February 10, 2016, 3:04pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/2 "2016-02-10T15:04:50Z")

</div>

Use the configureEditor extension function.

```auto
	if colName == 'englimitmode':
		return {'options': [(0, 'None'), (1, 'High'), (2, 'Low'), (3, 'Both')]}
```

---

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [March 30, 2016, 6:24pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/3 "2016-03-30T18:24:58Z")

</div>

Hi!

Thanks for this post, it helped me as well. However, I’m running into an odd issue when using it. I can get the dropdown list to appear in the table, but when I make a selection from the list, the cell remains blank. Do I need to add code that actually changes the value of the cell to the selected item, or should it be doing this normally? I am seeing this behavior in the designer and the staging client.

Thanks!

---

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [March 30, 2016, 6:57pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/4 "2016-03-30T18:57:36Z")

</div>

I figured it out. I haven’t used the Power Table much before, so I didn’t realize that it doesn’t automatically accept edits. I needed to enable the “onCellEdited” extension function. Then I used the example code written there with one small change: instead of putting newValue into the cell, I needed to put the label associated with that value in the dropdown options, so I added a little code to map the value to the label properly and put the label into the cell.

All in all, thanks for the help!

---

<div class="post-metadata">

**Author:** ![shrikant](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@shrikant](https://forum.inductiveautomation.com/u/shrikant)\
**Post date:** [May 18, 2016, 5:26am UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/5 "2016-05-18T05:26:38Z")

</div>

Hello, I was looking to add a way to put drop down in a Power Table and I found this topic.

I have added the given code in ‘configureEditor’ extension function but I can not get drop down to appear in the table. Am I missing something else? My column data type in ‘String’.

Thanks!

---

<div class="post-metadata">

**Author:** ![DougSN](https://avatars.discourse-cdn.com/v4/letter/d/a9adbd/32.png) [@DougSN](https://forum.inductiveautomation.com/u/DougSN)\
**Post date:** [May 24, 2016, 9:19pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/6 "2016-05-24T21:19:21Z")

</div>

You might need to make the column with the dropdown “Editable” through the table Customizer.

---

<div class="post-metadata">

**Author:** ![shrikant](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@shrikant](https://forum.inductiveautomation.com/u/shrikant)\
**Post date:** [May 25, 2016, 12:26pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/7 "2016-05-25T12:26:48Z")

</div>

It worked. 😃

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.inductiveautomation.com/u/Ron)\
**Post date:** [November 10, 2016, 1:44am UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/8 "2016-11-10T01:44:31Z")

</div>

Is there a way to dynamically create the returned dictionary to the ConfigureEditor? Something like  
if colName = ‘Brands’:  
newDict = dict((k, v) for k, v in (e.split(’ - ‘) for e in self.strBrands.split(’,’)))  
return {‘options’: [newDict]}

where the dynamic property strBrands is something like “‘BrandA’-‘BrandA’,‘BrandB’-‘BrandB’…”

---

<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:** [November 10, 2016, 10:19pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/9 "2016-11-10T22:19:55Z")

</div>

Ron,  
Yes, it is possible to construct the list dynamically. I modified your code slightly:

`if colName == "type":
	brands = "'BrandA'-'BrandA','BrandB'-'BrandB'"
	newList = [(k, v) for k, v in (e.split('-') for e in brands.replace("'","").split(','))]
	return {'options': newList}`

---

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.inductiveautomation.com/u/Ron)\
**Post date:** [November 11, 2016, 12:37am UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/10 "2016-11-11T00:37:28Z")

</div>

Thanks Paul.

---

<div class="post-metadata">

**Author:** ![Jfrantz](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@Jfrantz](https://forum.inductiveautomation.com/u/Jfrantz)\
**Post date:** [October 6, 2021, 5:21pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/11 "2021-10-06T17:21:34Z")

</div>

Is there a way to reference a Dataset for the Options?

---

<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:** [October 6, 2021, 5:30pm UTC](https://forum.inductiveautomation.com/t/adding-dropdown-box-into-powertable/11188/12 "2021-10-06T17:30:05Z")

</div>

If you need dynamic flexibility, take a look at this post:

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