# Query Binding Ondemand Only

**URL:** <https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [October 25, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957 "2023-10-25T12:53:48Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 25, 2023, 12:53pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/1 "2023-10-25T12:53:48Z")

</div>

I've got a perspective application that has a table that allows the user to pull data from a database over a different number of selection criteria. There is a custom property on the view that has a Query Binding and I'm passing in that selection criteria.

Is there any way to 100% control the execution of that Query Binding? I don't want the binding to execute on view startup etc... until I issue a refreshBinding onto that property.

I'm thinking that the only way to do this is with a script in the background, I just want to make sure before I re-work things to go that route.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Hayden\_Watson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/hayden_watson/32/48792_2.png) [@Hayden\_Watson](https://forum.inductiveautomation.com/u/Hayden_Watson)\
**Post date:** [October 25, 2023, 12:56pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/2 "2023-10-25T12:56:39Z")

</div>

Sounds like you just want to run a named query in a button or other method using the script `system.db.runNamedQuery`?

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 25, 2023, 1:01pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/3 "2023-10-25T13:01:29Z")

</div>

In Vision I can control the execution of bindings to a point. So I was hoping there was something similar with a Perspective Query binding.

Ultimately I'm probably going to have to script it, it'll just take a bit on this system to go through everything and I was hoping to keep the bindings like I have them to keep the work to a minimum.

---

<div class="post-metadata">

**Author:** ![bmeyers](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmeyers/32/37453_2.png) [@bmeyers](https://forum.inductiveautomation.com/u/bmeyers)\
**Post date:** [October 25, 2023, 1:55pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/4 "2023-10-25T13:55:40Z")

</div>

[https://docs.inductiveautomation.com/display/DOC81/Perspective+Component+Methods#PerspectiveComponentMethods-RefreshingBindings](https://docs.inductiveautomation.com/display/DOC81/Perspective+Component+Methods#PerspectiveComponentMethods-RefreshingBindings)

If any of the selection criteria change you can issue a refreshBinding although you mention that in your post so I am not sure if you mean something else.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [October 25, 2023, 2:11pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/5 "2023-10-25T14:11:46Z")

</div>

Saw a recent post asking similar and they mentioned there is no debouncing going on with a NQ binding that has other values fed into the parameters, so if someone changes one filter criteria - that runs the NQ. Then they change the next criteria - that reruns the NQ, even if its 1/10 of a second later. The only way here to have complete control is with scripting I think.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 25, 2023, 2:26pm UTC](https://forum.inductiveautomation.com/t/query-binding-ondemand-only/80957/6 "2023-10-25T14:26:56Z")

</div>

That is exactly the issue I'm having. Changing one parameter issues a refresh even if both are changed via scripting.

So I'll start working on doing things via scripting.
