In an app I am building, I want to query one table in my Retool DB, loop through the rows, do some calculations on each row, and then store the calculation results in another table. I've read a bunch of Retool documentation and believe the best practice solution would be:
. Create a query to retrieve rows from Table1
. Create a query to upsert rows into Table2
. Write a JS query that is triggered by an event handler of a button click
. In the JS query, trigger the Table 1 query
. Then write a function that process each row of the .data result
. In the processing function, run the upsert query
Does this outline describe a recommended way to accomplish my objective?
Thanks.