How to return query result to javascript variable?


How can I trigger a select query to return results to a javascript variable?

I am trying this:

return qry_if_table_exists.trigger({
additionalScope: {

But not working.



I'm not sure if I understand correctly, but here's how you could save the results of a SQL query to a JavaScript variable (as far as I understand your question!). I added an event handler to the SQL query that triggers a JS query that then saves the to a variable that you can use in a JS query.

Please, let us know if you have any further questions!

1 Like

Thanks, it worked.

Great news! Thank you ricky-raven! :grinning_face_with_smiling_eyes:

Looks like for some strange reason the 'results' is not getting the latest value.

Here are more details Why is query.trigger not using new values of additional scope variable?