# Popup window to db.refresh table on main window?

**URL:** <https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231>\
**Category:** Ignition\
**Created:** [September 10, 2013, 2:41am UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231 "2013-09-10T02:41:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![matkent](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@matkent](https://forum.inductiveautomation.com/u/matkent)\
**Post date:** [September 10, 2013, 2:41am UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231/1 "2013-09-10T02:41:56Z")

</div>

Hello,

I have a table on the main window which reflects a db. I have a button which opens a popup window with input fields (just a form) etc for adding to the DB (table on the main window).

Once all the fields are filled in the operator presses the “add record” button which performs the SQL query that adds it to the DB and calls a close popup function at the end.

Now to see the new record in the table you have to wait for the poll rate to update it (looks laggy).

Can I somehow get the final part of the SQL script on the popup form to execute a db.refresh on the table ON THE MAIN WINDOW. I can’t seem to work out the event objects to do this.

Cheers.

Mat Kent.

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [September 10, 2013, 4:06am UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231/2 "2013-09-10T04:06:18Z")

</div>

Hi Mat Kent,

In the popup window script use the system.gui.getWindow(name) function to get the main window.

For example:

> [@](#):
>
> win = system.gui.getWindow("Main Windows/Main Window 1")  
> system.db.refresh(win.rootContainer.getComponent("Table"), "data")

Cheers,  
Nick

---

<div class="post-metadata">

**Author:** ![matkent](https://avatars.discourse-cdn.com/v4/letter/m/34f0e0/32.png) [@matkent](https://forum.inductiveautomation.com/u/matkent)\
**Post date:** [September 13, 2013, 3:04am UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231/3 "2013-09-13T03:04:03Z")

</div>

Thank you for your help Nick, this works perfectly 🙂

---

<div class="post-metadata">

**Author:** ![nruimveld](https://avatars.discourse-cdn.com/v4/letter/n/8797f3/32.png) [@nruimveld](https://forum.inductiveautomation.com/u/nruimveld)\
**Post date:** [April 5, 2018, 3:44pm UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231/4 "2018-04-05T15:44:14Z")

</div>

Has this been updated for future versions of Ignition? This doesn’t seem to fire for me when I try it.

---

<div class="post-metadata">

**Author:** ![Aaron\_Ekstrand](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Aaron\_Ekstrand](https://forum.inductiveautomation.com/u/Aaron_Ekstrand)\
**Post date:** [December 22, 2021, 11:21pm UTC](https://forum.inductiveautomation.com/t/popup-window-to-db-refresh-table-on-main-window/7231/5 "2021-12-22T23:21:58Z")

</div>

Is there a way to do something like this in Perspective as well?
