How to prevent query from being triggered due to an input value change

I have a query that taken several inputs from the user interface (e.g. text_input_1.value, text_input_2.value, ...)

My intention is the query is only triggered when the user clicks a button (e.g. submit_button).

However, I noticed, sometimes, the query is triggered when these input values are set by other scripts.

How do I prevent the query being triggered other than clicking the submit button?

Hey there @Wei_Chen,

I think the easiest way is to change your query's "Run Behavior" setting to "Manual" so that only event triggers set up in your app trigger that (you can also set it up so that the query runs on page load)

@MiguelOrtiz thanks for your reply.

but the weird thing is the query is set to manual.

Hey @Wei_Chen,

That is odd if you have it set to manual. From the state tab you can inspect the query and see what it is controlled by at the bottom. This will list out what can trigger a query to run.

Hi @Wei_Chen,

Just wanted to follow up and see if you were able to change the query from automatic to manual for the run behavior? If it is set to manual, it should not be running on variable change.

Or see if there was another component that was triggering the query.

Thanks for the follow-up, @Jack_T . I haven't checked the details yet to determine what 's the cause. I will let you know if I find anything.

1 Like