How to overwrite a Google Sheet with Workflow SQL Query Results

Yes, that was using the API directly. If you've set up the Google Sheets resource in Retool, you should be able to accomplish it with the Update a spreadsheet option, clicking "Use A1 notation" and setting that to the value of your sheet. Keep in mind, if your new data isn't the same size/smaller, you might need to first clear your data by updating it with an empty array.

You can achieve that by doing something like this:

image

Which would empty the first 20 rows x 10 columns. The code in the values box is

{{  Array.from({ length: 20 }, () => Array(10).fill("")) }}
2 Likes