Disable query vs. Skip query

I figure that Disable query is misleading. It's different then skipping, as it doesn't run anymore once disabled and re-enabled after.

Use case:

  • I have a insert bulk query to BigQuery that runs every 30s. * Source is a temp state
  • If the state value is not an object, skip this run

So I entered this in Disable query condition:
{{ typeof newActions.value !== 'object' }}. Problem is that even if this evaluated to true and to false lter (something to insert), the loop has stopped.
Once disabled, you must re-run it.
Is that by design ?

Note, there is no good workaround i.e. if I change array of records to insert to {{ (typeof newActions.value === 'object') ? Object.values(newActions.value) : [] }}, retool engine still calls the resource if nothing to insert as I see an empty BEGIN/COMMIT in bigquery's logs. That's a bug to me.

On the latter, bulk insert query - maybe others too - is very picky: if I pass [], it calls but doesn't error out. If I pass null, it doesn't error out and the query runs forever (elapsed time endless). Only way out is to refresh the app/page. Why can it just skip or raise error ?

I've used that logic and it worked ok for me.
Having the "disabled query" value work out if there's something for it to process on a query that runs periodically is how I initially did an "autosave" feature in an app.

Might be something in your set up or the value of your temp state which is causing the issues, maybe you can share some screenshots with the values it evaluates them as?

Quick and dirty example, runs every 2 seconds if a temp contains an object and shows the run time in the timeline box - the two buttons change the temp to an object or "not an object" which enables/disables the query from running BUT it's "skipping" the run and will continue if you change the temp without you needing to re-run it.
I think that's what you're trying to do?
forum.json (12.9 KB)