当 Google Sheet 编辑时触发 webhook

sun*_*ong 7 google-docs webhooks google-docs-api

我制作了一个谷歌表,用于与同事共享待办事项列表。

我希望在修改该表时,将消息发送到 slack 频道。

即使试图找到与此相关的 api,我也没有找到合适的。

是否有合适的 API 或 webhook?

noo*_*gui 8

Drive API 的推送通知可让您观察资源的变化。您还可以使用 Apps Scripts 的onEdit触发器,它的作用更像是一个实时检查器。

function onEdit(e){
  // Set a comment on the edited cell to indicate when it was changed.
  var range = e.range;
  range.setNote('Last modified: ' + new Date());
}
Run Code Online (Sandbox Code Playgroud)

论坛还可能提供更多见解。