Expand Query 'Watched Inputs' to include any variable

Currently, it appears that the Watched inputs for any SQL query are limited to the inputs explicitly made available to the query. While this behavior is suitable for many cases, I have encountered scenarios where it would be more effective to monitor all inputs—that is, any variables within scope.

To be clear, I am referring to the following menu:
screenshot

In my particular situation, when a module on the page exposes an output variable, I want the ability to refresh my grid whenever that variable changes. My current workaround is to include the variable in a non-functional clause like (WHERE true OR 1={{ var.value }}). While this approach works, it feels more like a hack than a proper solution.

P.s. A more robust and elegant solution, in my view, would be to introduce a "Listener" option for each module used elsewhere. This listener would respond to events emitted from within the module itself, rather than relying solely on properties.

Hey @emozio! Thanks for reaching out.

I find the "Watched inputs" option to generally be in an odd place, as it does literally nothing if the query's "Run behavior" is set to Automatic. It should really only be enabled if the behavior is set to Manual, as then it has some actual utility. I can think of a couple ways to integrate this existing functionality with the idea that you've proposed, but I'll pass on your feedback and let the Product team take it from there!

For what it's worth, the workaround that I typically use is very similar! I'll build a dummy query - usually of type "Query JSON with SQL" - that references the inputs I want to listen to and then add my actual query as a success callback.

Thanks again for the feedback! I'll provide an update here as soon as I can.

1 Like