How to Refresh Table Output Once Query Runs

I have an app that uses an upload button to read a csv, then parses the csv with javascript, then populates a sql query with the javascript. I then have to click the refresh button for it to populate the output table.

Any advice on how I can have an even trigger to refresh the output table once the sql query runs?

In the Event Handlers of your script, just add the query.trigger to populate the table.

thanks, that worked!
How do I get it to stop re triggering? throttle?
Screen Shot 2023-07-20 at 6.25.34 PM

I could be wrong, but I believe that when a table is Refreshed, it will automatically re-trigger the query where it's data is populated from. So therefore, if you have a success event handler on that query that refreshes the table, it will call the query on a loop. I'm not sure if there is a way to turn this off (I haven't done any research).
Again I could be wrong, but if you are using the New Table, when the query, the table is attached to, is run, then the table will automatically refresh with the data. So therefore, no need to call refresh on the table when the query is called.
Hope that helps.

I am having the loop issue. When I upload the CSV, I have to click the refresh button on the table to refresh once.

Adding the event trigger, created the constant loop. The table would not refresh without a manual refresh or the undesired loop.

Resolved: Query setting was set to Manual. Updated to "Run query automatically when input changes"

2 Likes