I want to programmatically download all data tables using a Javascript query and SQL. The SQL code reports an error that my variable is undefined. How can I fix it so it is "defined"?
SQL:
SELECT * FROM {{tableName}}
Javascript:
const selectedTables = checkboxTables.value; // Get selected table names from Checkbox Group
Instead of this code use your code for return the data with that checkbox condition and from the query event handler you can download the data in csv format.
Were you able to find a work around to disabling prepared statements?
Also did @WidleStudioLLP's solution not work? You mentioned that not all your tables are "referenced in the interface" and I was curious about what you meant by that.
Are the tables spread across multiple pages of a multiple page app? Or are the DB tables not all being queried and displayed in the app UI?
Another option would be using workflows! You can set up a loop block to query each DB, pass in params such as the table names and iterate through these with the loop. Then, after each query runs, download the file data to a CSV.
No, I did not find a suitable way to disable prepared statements. The DB tables are not all being queried by the UI. I can try the looping through the tables and returning the names.