Error in Disable Query

Hi there!
I am trying to "pause" a periodically query when something occurs with "Disable Query", in this case when o Component.type changes (image). I am using un sendgrid integration and it doesn't working well because I am receiving mails when the condition is "true".

(['Horario mercado'] == 'cerrado') 
``` is always 'cerrado'. This is not the problem

Please help me! :slight_smile:


Hey @DavidG!

What kind of resource is this? And does the disable field work properly if you just pass {{true}}?

Sorry, I don't understand what did you want to say with "resource".

Yes! if I pass {{true}} the disable query works! I was reading about it and the thing is that Retool "recognize" an "inti-disable" query (false) when occurs a refresh on the fields, doesn't matters if the value of the field doesn't change

Oh Sorry, actually was you in the other post!

:thinking: it will be prompted to run again when that input changes but as long as the "Disable query" field evaluates to true it shouldn't actually run.

I'm curious what happens here with some further testing. Could you try setting {{ alert1.type == 'success' || (['Horario mercado'] == 'cerrado') || true}} and let me know if that works? It could be that, while['Horario mercado'] should always equal 'cerrado', it hasn't yet been populated when you load the app for instance.

You can also try setting up a separate query to run tests on that might be a little more contained, and might also let us see if this is happening specifically with sendgrid queries. Maybe just a Query JSON with SQL query that returns the value of alert1.type == 'success' || (['Horario mercado'] == 'cerrado') or so (2 birds with one stone!).

Let me know what the results are!

Hi @Kabirdas! If I put "true" as a condition, it will never runs, no? I think it's an ingenious feature but I want that the query runs, eventually.

The problem is not in (['Horario mercado'] == 'cerrado' because I have tryed without this condition, so the problem is in the condition of the component "alert1.type". The thing is that the component is runnning all the time because it is evaluating a real time metric. And I think that there is a couple of seconds where "Disable Query" detects false in that conditions because it is loading and is not especifically "success". My reasoning comes from your explanation in the post that I have already mentioned.

What do you think about?

Yep! If true is part of the condition it should never run, the suggestion was only a test to make sure the logic in the disable field wasn't being ignored just in case we have a bug on our hands. If['Horario mercado'] is always equal to 'cerrado' though I would expect the query to also never run :thinking: Maybe I'm misunderstanding something here?

It'll probably be helpful if we can get a broader look at your setup. I think you're on the right track but it might be useful to get more context. If you have a cloud org that we can step into it might be helpful for you to write to support via chat so that we can take a closer look at your app. Otherwise, exporting your app and sharing the JSON with us could help as well!