首页 / 实操指南 / how-to-use-the-google-sheets-watch-changes-module

how-to-use-the-google-sheets-watch-changes-module

综合教程 建议阅读时间: 5-8 分钟

2020年1月22日 | 4分钟阅读

如何使用 Google Sheets 监听变更模块

了解如何在 Google 表格更新时自动发送电子邮件。以下是由 Integromat 团队为您提供的分步指南!

![How to Use the Google Sheets Watch Changes Module](__CODE_BLOCK_0__ What this scenario does: Watches for changes on a Google Sheet, instantly retrieves the new information and emails the information to the intended recipient. Level of difficulty: Beginner Implementation Time: Approximately 20 mins Prerequisites: The following is needed to set up the scenario: A Google account for Google Sheets and Gmail If you like to learn more about these apps, check out our support articles on [Google Sheets](__CODE_BLOCK_1__ and [Gmail.](__CODE_BLOCK_2__ ‘Webhooks are Wonderful’ is an expression you will hear on Make , but what makes them wonderful? Well, a Webhook delivers [instant](__CODE_BLOCK_3__ notifications whenever a certain change occurs in the third party service. Keyword — _Instant._ As opposed to scheduling a scenario to execute every 15 minutes for example. Sometimes referred to as a ‘Reverse API’, it’s basically a ‘don’t call us, we’ll call you’ concept. This tutorial shows you how to create a simple scenario that receives information instantly using a Webhook. Let’s get to it.

Step 1: Add the Google Sheets app

Create a Google sheet and label it. We have labeled ours Time-sheet. Make sure to add column headers describing the data that you want to store in the sheet: * Go over to your Make dashboard. To create the scenario, click on the Create a new scenario button on the top right corner:

![create-a-scenario-button-make](__CODE_BLOCK_4__ * You will see an empty module with a plus sign. Click on the plus sign , search for the _Google Sheets_ app and select it:

![google-sheets-app-make](__CODE_BLOCK_5__ * Now click on the Watch changes trigger module since you want to watch for any changes on the Google Sheet. You will notice that it has an Instant tag:

![watch-changes-app-make](__CODE_BLOCK_6__ * Now you need to add a Webhook by clicking Add or select an existing one from the dropdown list:

![creating-a-webhook-make](__CODE_BLOCK_7__ * You can edit your Webhook name and click Save.

Step 2: Install the Integromat add-on

Next, you need to install the Integromat Add-on to the Google Sheet (_please note that the add-on is still labelled as Integromat, not Make_)。在 _Google Sheets_ 模块中点击 复制地址到剪贴板: !copy-address-button-make

* 现在再次回到您的表格。为了使用 _即时_ 触发器,必须安装 Integromat 加载项,并在 Make 模块与 _Google Sheets_ 模块之间建立连接。点击 加载项 选项卡,然后点击 获取加载项

!add-ons-make-scenario

* 搜索 Integromat 并点击其缩略图:

!

* 点击 安装,然后点击 继续

!

* 现在点击 允许,授予 Integromat 访问权限:

!

* 安装完成后,再次点击 加载项 选项卡,选择 Integromat 并点击 设置

!

* 最后,将链接粘贴到 Webhook URL 字段中,并点击 保存

!

Webhook 已成功关联至该表格,_Google Sheets_ 模块现已完全配置完毕!

第3步:添加执行操作模块

在这里,您可以添加所需应用的操作模块。在本示例中,我们使用的是 _Gmail_ 应用和 _发送邮件_ 模块。

点击 _Google Sheets_ 模块右侧的小圆圈以添加另一个模块。在搜索框中搜索 Gmail 应用并选择它: !gmail-app-make

* 接下来,选择 _发送邮件_ 模块:

!send-an-email-module-make

* Make 需要知道要连接哪个账户。点击 添加 按钮,连接您的 Google 账户,或从下拉列表中选择一个已有账户:

!gmail-connection-make

* 您可以编辑 连接名称,然后点击 保存

!connection-name-make-gmail

* 登录您的 Google 账户,并点击右下角的 允许 按钮,授予 Make 对您账户的访问权限:

!

* 添加收件人的电子邮件地址和邮件主题。在内容框中,添加所需内容,并映射 Google 表格中的 Row values [1]: ARow values [1]: B 字段:

!gmail-setup-make

* Functions 极其有用且被广泛使用,可将项目值转换为各种形式。此处使用了 formatDate 函数,将日期格式化为“DD-MM-YY”。该函数位于 Date and time 选项卡下:

!date-function-make-scenario

_Gmail_ 模块现已完全配置完毕!

第4步:测试场景

现在是时候测试场景了。首先,点击屏幕底部的 保存 按钮保存场景: !save-button-make

* 现在点击 运行一次 按钮来执行场景:

!run-button-make

* 返回表格,只需添加至少一行数据:

!

* 您可以看到执行已成功。点击带编号的圆圈即可查看每个模块的输出。该数字表示单次执行中每个模块所消耗的操作数:

!

* 您可以看到 _Google Sheets_ 模块输出了 1 个数据包,对应表格中的那一行数据:

!

* 如果查看 _Gmail_ 模块的输出,您会发现从 _Google Sheets_ 模块传递过来的数据包作为输入,并已将包含所需信息的电子邮件发送给了指定收件人:

!

* 由于测试成功,最后一步是点击左下角的开关,将场景设为 开启 状态:

!on-switch-make

就是这样!现在,您可以创建一个简单的场景,监听 Google 表格的变更,并即时接收新信息!

祝您自动化愉快!

⭐ 核心工具推荐

执行本指南:你需要 Make.com 账户

本指南中的自动化流程均基于 Make 平台构建。注册免费账户即可直接复刻我们测试过的场景。

  • 即刻获得 1,000 免费额度
  • 完全还原文章中的可视化体验
  • 通过右侧按钮可直接绑定官网注册
  • 无需懂代码即可跑通流程
★★★★★
4.6/5 (G2 评分, 2,400+ 评价)
* 通过上述链接注册不产生额外费用
/>