# Scripting - Update/Refresh component before SQL query starts

**URL:** <https://forum.inductiveautomation.com/t/scripting-update-refresh-component-before-sql-query-starts/19281>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [August 16, 2018, 9:26am UTC](https://forum.inductiveautomation.com/t/scripting-update-refresh-component-before-sql-query-starts/19281 "2018-08-16T09:26:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ross\_warwick](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@ross\_warwick](https://forum.inductiveautomation.com/u/ross_warwick)\
**Post date:** [August 16, 2018, 9:26am UTC](https://forum.inductiveautomation.com/t/scripting-update-refresh-component-before-sql-query-starts/19281/1 "2018-08-16T09:26:00Z")

</div>

I’m new to Ignition.

In my project some components are set (calendar dates etc.) and when the search button is pressed a script runs a SQL query. The execution time can be a while (depending on the date range). I want to indicate to the user that the project is running the query and not frozen. I tried disabling the search button and changing the label to “Please Wait” but it didn’t change. I tried linking to a tag and changing the text that way but no luck.

Is there a way to update/refresh components before the query starts or better way of informing the user of a running query?

Setup

- Ignition Platform 7.6.6
- SQL Bridge Module 5.6.6
- Vision Module 6.6.6
- Alarm Notification Module 1.6.6
- Reporting Module 1.6.6
- Symbol Factory Module 2.7.0

---

<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:** [August 16, 2018, 10:30am UTC](https://forum.inductiveautomation.com/t/scripting-update-refresh-component-before-sql-query-starts/19281/2 "2018-08-16T10:30:48Z")

</div>

Don’t run queries from event scripts. Don’t run anything that takes more than a fraction of a second in an event script, or your whole client can freeze. Use system.util.invokeAsynchronous() to run a separate procedure in the background, and have that procedure use system.util.invokeLater to send progress to the foreground.

---

<div class="post-metadata">

**Author:** ![ross\_warwick](https://avatars.discourse-cdn.com/v4/letter/r/3bc359/32.png) [@ross\_warwick](https://forum.inductiveautomation.com/u/ross_warwick)\
**Post date:** [August 16, 2018, 10:49am UTC](https://forum.inductiveautomation.com/t/scripting-update-refresh-component-before-sql-query-starts/19281/3 "2018-08-16T10:49:33Z")

</div>

Thanks for the quick response.

I’ll look into those system utils.
