Append multiple rows into a spreadsheet from Query JSON with SQL

I need help to do this in retool.
Is there a way to bulk insert into a spreadsheet?

I've only been doing single row inserts in retool and now i need to do a bulk insert.

I have a JSON-SQL query which results to more than 1 row and I want to insert each result into a spreadsheet. Something like a forloop.

Something like this:

Result = JSONSQL.execute();
For (i=0; i < result.numberofrows; i++) {

AppendtoSpreadsheet(col1 = result.col1[i].data;

}

Hey @Kimhok!

What type of DB are you using and what version of Retool are you on?

A number of resource types have different methods for appending rows to your database. To take the Google Sheets resource as an example, you can use the "Append data to a spreadsheet" action to add multiple rows to your sheet at once:

Hi Kabirdas,

I found the fix. Recently saw a retool document for iterating Query results in Retool while triggering a query (for my case, an insert into spreadsheet query) . Here is the link and it works perfectly:

Link: https://docs.retool.com/docs/scripting-retool#section-triggering-a-query-for-each-item-in-an-array