我有一个动态电子表格,每分钟都会提取数据。 我有一个 Apps 脚本,可以在格式化表格中显示这些数据。 我想知道是否有办法让它每分钟左右刷新一次数据? 我尝试设置以下内容,并将 ResetForm() 链接到触发器...但这不起作用。触发器仅在服务器上运行......而不是在客户端上运行。如果我刷新页面,就会出现新值。 任何建议将不胜感激!
function resetForm(e){
var app = UiApp.getActiveApplication();
app.remove(0);
return createApp(app);
}
function doGet(e){
return createApp(UiApp.createApplication().setTitle('Enterprise Operations Requests'));
}
function createApp(e){
var app = UiApp.getActiveApplication();
//This is where I have the code for the table with dynamic data
}
Google Apps 脚本中没有可用于实现此功能的 onTimer 函数。但是,我提供了一个复杂的解决方法作为对旧论坛中问题的答复(http://productforums.google.com/forum/#!mydiscussions/apps-script/2pqhh_eTIvQ)。
请查看我在那里发布的代码,如果您还有其他问题,请告诉我。
您可以在 HtmlService 中执行此操作,但不能在 UiApp 中执行此操作。