If you want to view the results of a Query to a MySQL Database/Resource, you should be able to do this in the Query view panel. Next to the 'Save' button there is a 'Preview' and the results of the query will appear at the bottom of the query panel.
You can add in a console.log to the transform results box below the query inside the query panel as well.
Thank you for sharing the screenshot with the mark up!
I believe the error might be coming from the @ symbol you used to define and save the TTax variable.
Let me experiment around and see if there is a work around for saving that value without the @ symbol or if that is a bug which Retool needs to fix
I had not seen anyone use @ or := in SQL so I just learned that those are both valid and being used properly. In the transformer result, I see there is a red underline. If you hover your mouse over that, is it giving you the same error?
I also see on line 18 you set the variable TOTAL to be equal to @TTax, maybe you can console log that variable?
I might need to see the whole query or a boiled down version of the query to replicate it and test out how we can get that summation of tax to appear in a console log!
It looks like we should be able to view the variable you are creating from the results tab of the MySQL query.
Are you able to run the query and see in the output, under 'data' the @TTax variable?
From the Success query event at the bottom of the query, we can run a separate Javascript Query that console logs the variable from TaxFillTableInv.data to get @TTax to show up in the console!
The JS Query will have access to the 'TaxFillTableInv' and you can key into the .data property with something like TaxFillTableInv.data['@TTax']
I was poking around the forums and found this post you will want to do pretty much the same thing but instead of the Action being 'set to local storage' you would select 'Run Script' and console.log(TaxFillTableInv.data['@TTax']).
Let me know if that works!
I just tested it out, and the editor has a yellow line under the query name, on hover it says 'that query is undefined' but this is a false bug and it should work fine. As the query result and its data are created when the query runs!