# Detect Loading Data from Named Query

**URL:** <https://forum.inductiveautomation.com/t/detect-loading-data-from-named-query/49904>\
**Category:** Ignition\
**Created:** [August 13, 2021, 3:51pm UTC](https://forum.inductiveautomation.com/t/detect-loading-data-from-named-query/49904 "2021-08-13T15:51:15Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [August 13, 2021, 5:23pm UTC](https://forum.inductiveautomation.com/t/detect-loading-data-from-named-query/49904/4 "2021-08-13T17:23:09Z")

</div>

So, we don't provide any ability to 'introspect' the bindings and know that they're in progress. What you can do instead of bindings is issue your named query from scripting; you'll want to wire up the appropriate `propertyChange` scripting events to fire your script, _but_ if you do that then you'll be able to set some 'loading' flag (and react to that in your UI accordingly) and then, _in a background thread_, execute your named query (and then jump back to the EDT to deliver the results).  
It's an immediate, significant jump in complexity, unfortunately, but is the best way to get what you want.  
@pturmel wrote a scripting module, `later.py`, that helps a lot with the 'boilerplate' around running an async task and returning results on the main thread:

> [@Update GUI via Asynchronous thread](https://forum.inductiveautomation.com/t/update-gui-via-asynchronous-thread/9666/3):
>
> Since this sort of thing pops up often, I created a set of wrappers that simplify this stuff, and allows you to directly use functions in your script modules. The wrappers take care of stuffing the arguments you supply into a temporary fuction’s default argument. For your case, try assignLater(). Nick’s example becomes: # In a script module in your project: import shutil def fileTransfer(label): path = system.file.openFile() newPath = "F:\NewFolder" shutil.copy2(path, newPath) sh…

---

_[View the full topic](https://forum.inductiveautomation.com/t/detect-loading-data-from-named-query/49904)._
