How to overwrite or clear data in a Drive Table in Google App Maker

末鹿安然 提交于 2019-12-24 07:48:12

问题


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);


来源:https://stackoverflow.com/questions/42705379/how-to-overwrite-or-clear-data-in-a-drive-table-in-google-app-maker

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!