-->

How to overwrite or clear data in a Drive Table in

2019-07-31 02:35发布

问题:

I have loaded data from a Google Sheet into an App Maker datasource. Now I have made a change to the original sheet and want to import the new data and overwrite the old or alternatively just clear the existing data and import the new data from the sheet. I don't see a way to do either in the docs.

回答1:

I use the following command to clear a drivetable when needed:

app.datasources.DatasourceName.unload();

Edit:

This will clear the table on the client. To delete all Records in a drive table use the following server script:

var records = app.models.ModelName.newQuery().run();
app.deleteRecords(records);