# Dropdown menu save in Power Table

**URL:** <https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822>\
**Category:** Ignition\
**Tags:** ignition79, scripting, vision\
**Created:** [April 15, 2024, 3:04pm UTC](https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822 "2024-04-15T15:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [April 15, 2024, 3:04pm UTC](https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822/1 "2024-04-15T15:04:13Z")

</div>

I have three dropdown options and I want the value that is selected to be displayed in a power table. All are 'yes' and 'no' options. For example, if the user selects 'No' I would like it to show 'No' on the correct column in my table.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/1/61314764e17d7398a83e4084afe3fff50cfc82dd.png)

---

<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:** [April 15, 2024, 3:08pm UTC](https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822/2 "2024-04-15T15:08:12Z")

</div>

Okay.  
What have you tried?  
How is the dataset on the table being populated?  
If it's coming from a database, what happens when a user selects a value in the dropdown? Does it immediately apply (to the database as well)?  
How is the row in the table to update identified, or are all rows updated at the same time?

---

<div class="post-metadata">

**Author:** ![Mia\_Galatis](https://avatars.discourse-cdn.com/v4/letter/m/f14d63/32.png) [@Mia\_Galatis](https://forum.inductiveautomation.com/u/Mia_Galatis)\
**Post date:** [April 15, 2024, 3:10pm UTC](https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822/3 "2024-04-15T15:10:08Z")

</div>

I tried to associate the 'value' to a name and use if statement for each component.  
The dataset on the table is being populated by _system.db.runPrepUpdate_ when the user clicks on a 'Save' button.  
The process is a user adding information to a database so the previous rows cannot be changed.

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [April 21, 2024, 5:00am UTC](https://forum.inductiveautomation.com/t/dropdown-menu-save-in-power-table/88822/4 "2024-04-21T05:00:54Z")

</div>

> [@Mia\_Galatis](#):
>
> the correct column in my table

Is this for the selected row, or are you adding a row?

> [@Mia\_Galatis](#):
>
> he process is a user adding information to a database so the previous rows cannot be changed.

It sounds like you need to populate the power table only once at initialization, and possibly include a way to refresh if needed. A custom property could be used to temporarily store which rows have been locally edited, and then a simple update query could update the database using the primary key and data from the edited rows when the save button is pressed.

If you are adding rows, it's simpler. Just run an insert query with the new locally created data.

Here is the relevant documentation for what it seems you are trying to accomplish:  
• [Vision 7.9: Named Query](https://www.docs.inductiveautomation.com/docs/7.9/sql-in-ignition/named-queries)  
• [Vision 7.9: Prep Update Query](http://www.poninsight.com:8088/main/system/help/system.db.runPrepUpdate.html)
