Delete thousands of records at once

Dear Community:

I will appreciate your help with the following query. I need to delete from AppSheet all the rows of a table. Now I can only delete rows one by one with the delete action, but I have tables with hundreds of records so it would help to have an action that deletes all records at once. Thank you in advance for your help.

Rafael

0 4 195
4 REPLIES 4

Please check the reply in your another post, but I definitely do it with a webhook as I believe you have at least Core subscription.

Thanks Aleksi!

JSO
Silver 2
Silver 2

Try doing it directly with a GoogleScript function call. An example function for this could be:

function clearAllRecords(sheet, table) {
    var sheet = SpreadsheetApp.getActive().getSheetByName(sheet);
    var range = sheet.getRange(table);
    for (var i = 0; i < range.getMaxRows(); i++) {
      range. deleteRow(i);
    }
}

In sheet you must put the name of the sheet with its complete path and in Table the name of the same.

clearAllRecords("MyFolder/MyFolder1/MiFolder2/MySheet", "MyTable");

Although it seems that it is the same as deleting from ApPSheet, this is only a call to the Google Server and it is in charge of executing it.
Then you will have to make sure that the data is synchronized in AppSheet.

Thanks a lot @JSO ! I will try to follow your idea.

Top Labels in this Space