如何在 Google App Maker 中覆盖或清除驱动器 Table 中的数据
How to overwrite or clear data in a Drive Table in Google App Maker
我已将数据从 Google Sheet 加载到 App Maker 数据源中。现在我对原始 sheet 进行了更改,并希望导入新数据并覆盖旧数据,或者只是清除现有数据并从 sheet 导入新数据。我在 the docs 中看不到任何一种方法。
我在需要时使用以下命令清除驱动器table:
app.datasources.DatasourceName.unload();
编辑:
这将清除客户端上的 table。要删除驱动器 table 中的所有记录,请使用以下 服务器脚本 :
var records = app.models.ModelName.newQuery().run();
app.deleteRecords(records);
我已将数据从 Google Sheet 加载到 App Maker 数据源中。现在我对原始 sheet 进行了更改,并希望导入新数据并覆盖旧数据,或者只是清除现有数据并从 sheet 导入新数据。我在 the docs 中看不到任何一种方法。
我在需要时使用以下命令清除驱动器table:
app.datasources.DatasourceName.unload();
编辑:
这将清除客户端上的 table。要删除驱动器 table 中的所有记录,请使用以下 服务器脚本 :
var records = app.models.ModelName.newQuery().run();
app.deleteRecords(records);