# Dropdown list linked to Database

**URL:** <https://forum.inductiveautomation.com/t/dropdown-list-linked-to-database/40429>\
**Category:** Ignition\
**Created:** [November 9, 2020, 12:27am UTC](https://forum.inductiveautomation.com/t/dropdown-list-linked-to-database/40429 "2020-11-09T00:27:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chaoliang](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chaoliang](https://forum.inductiveautomation.com/u/chaoliang)\
**Post date:** [November 9, 2020, 12:27am UTC](https://forum.inductiveautomation.com/t/dropdown-list-linked-to-database/40429/1 "2020-11-09T00:27:55Z")

</div>

Hi,

I want to create a dropdown list, which is linked to a database integer tag.  
Database tag:  
Name: Mode  
datatype: Integer  
value: 0: Off, 1: Manual, 2: Auto

I want to have dropdown list on the screen, it should display the description of the selected mode (Off/Manual/Auto) and the operator can select the new mode. Once the selection is done, it can update the mode integer value in the database.

The display of the current selected mode is not an issue. I have created a database tag associated with the mode. But I have issue to modify the mode from dropdown list on the screen.

I understand that to update the database linked tag I need to write script "system.db.runUpdateQuery". But while entering script from the event script window, I cannot find the right event handlers to choose.  
I was expecting some event like "Dropdown list selection complete" but it's not a option in the "event handlers" list.

I tried the script from the following post, but I cannot get it working correctly.

> [@Need a Dropdown Component Trigger off of completed selection](http://forum.inductiveautomation.com/t/need-a-dropdown-component-trigger-off-of-completed-selection/15039/13):
>
> Try replacing the DD with a reference to the DropDown Object. Let me see if I can find an example. #Pull a Reference to the DropDown Object you want to YourOwnDD = event.source.parent.getComponent('dd\_Filter') #Then branch from there #If you call from an event generator on the dropdown event.source.addPopupMenuListener(myPopUpMenuListener(YourOwnDD)) #If you call from anywhere else. YourOwnDD.addPopupMenuListener(myPopUpMenuListener(YourOwnDD)) #If you call from a a custom method. self.ad…

Appreciate if anyone can help on it?

---

<div class="post-metadata">

**Author:** ![rachel](https://avatars.discourse-cdn.com/v4/letter/r/46a35a/32.png) [@rachel](https://forum.inductiveautomation.com/u/rachel)\
**Post date:** [November 9, 2020, 12:52am UTC](https://forum.inductiveautomation.com/t/dropdown-list-linked-to-database/40429/2 "2020-11-09T00:52:54Z")

</div>

I think the event handler you’re looking for is ComponentEvents/onActionPerformed. What is the error you’re getting?
