I have a basic button on my Retool dashboard.
There's an on-click event handler which triggers a JS query.
This is a very simple script in which I want to perform some actions (such as trigger a MongoDB query and feed back the information to a table etc.). I'm just using the button to test my query before I allow it to run on page load.
When I click the button however, I don't see my console.log
anywhere.
Is this a bug?
Using the 'Run code' event handler, this works fine. But does not when I trigger the JS query. Why is that? I don't want to test my code in a 'Run code' event handler, I'd like to use my JS query instead - because that's what I will be using for other things on the page.
EDIT:
I have realised that this JS query needs a return value in order to actually trigger.
If I add return null
at the end of the script, I can see my console.log
...