# SQL Named Query - Message Box Input

**URL:** <https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056>\
**Category:** Ignition\
**Tags:** vision, scripting\
**Created:** [June 4, 2025, 8:52pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056 "2025-06-04T20:52:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://forum.inductiveautomation.com/u/warren)\
**Post date:** [June 4, 2025, 8:52pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/1 "2025-06-04T20:52:49Z")

</div>

I'm looking for the right script to use a gui input box as a way to rename my SQL table. I have a named query already set to update the database upon a certain parameter string, as I used to do this manually with a text box and button. How can I grab the text entered into this field? The key is I only want to use that text if the "OK" button is clicked, so I need a conditional way to grab the user defined text string.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/c/2c515bc90f05e67198a0d43a41f6b934ad6f0a58.png)

---

<div class="post-metadata">

**Author:** ![mdemaris](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mdemaris/32/54639_2.png) [@mdemaris](https://forum.inductiveautomation.com/u/mdemaris)\
**Post date:** [June 4, 2025, 8:56pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/2 "2025-06-04T20:56:34Z")

</div>

If I remember correctly from my reading, renaming DB tables is a REALLY bad idea. Why would you want to do that?

Can you use a table with a field to store the Process Name, with associated data in other fields?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 4, 2025, 8:56pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/3 "2025-06-04T20:56:57Z")

</div>

The entered value becomes the return value. If cancel is clicked, `None` is returned.

---

<div class="post-metadata">

**Author:** ![Warren\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@Warren\_McDonald](https://forum.inductiveautomation.com/u/Warren_McDonald)\
**Post date:** [June 4, 2025, 9:13pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/4 "2025-06-04T21:13:03Z")

</div>

Named Query is not updating the MySQL table. It’s updating a cell in a MySQL table which stores all the various recipes I query.

Need to pull text from that input box and reassign a name from that

---

<div class="post-metadata">

**Author:** ![Warren\_McDonald](https://avatars.discourse-cdn.com/v4/letter/w/91b2a8/32.png) [@Warren\_McDonald](https://forum.inductiveautomation.com/u/Warren_McDonald)\
**Post date:** [June 4, 2025, 9:15pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/5 "2025-06-04T21:15:59Z")

</div>

How do I reference the buttons to update the line below?

Even.source.text = SQLupdatetext

---

<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:** [June 4, 2025, 9:16pm UTC](https://forum.inductiveautomation.com/t/sql-named-query-message-box-input/107056/6 "2025-06-04T21:16:52Z")

</div>

Show us as much of your script as you can, because it's really hard to explain the right thing to do if we're not sure what you've actually done.

Capturing the input (if the user didn't cancel) of an input box is literally the example on the UM page:

> **[system.gui.inputBox | Ignition User Manual](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-gui/system-gui-inputBox#code-examples)**
>
> Opens up a popup input dialog box.
