Google Sheets Subscribe

In this article

Overview

You can use Google Sheets Subscribe Snap to subscribe to the specified spreadsheet for notifications of the changes in the Google Sheet.

image-20240117-052126.png

Snap Type

Google Sheets Subscribe Snap is a READ-type Snap.

Prerequisites

None.

Support for Ultra Pipelines  

Works in Ultra Pipelines

Limitations

  • This Snap does not support Shared Drive or other Drives—it supports only My Drive.

  • You will receive multiple notifications if you subscribe to a Spreadsheet with multiple channels simultaneously.

  • If you configure Webhook URL using a Triggered task, there is a two to four-minute delay in receiving notifications on the Channel or Spreadsheet.

Snap Views

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Type

Format

Number of Views

Examples of Upstream and Downstream Snaps

Description

Input 

Document

  • Min: 0

  • Max: 1

  • Mapper

  • Copy

The Spreadsheet name or ID, Channel ID, and Webhook URL.

Output

Document

  • Min: 1

  • Max: 1

  • Mapper

The Snap returns ID, resource ID, and resource URI.

Error

Error handling is a generic way to handle errors without losing data or failing the Snap execution. You can handle the errors that the Snap might encounter while running the Pipeline by choosing one of the following options from the When errors occur list under the Views tab:

  • Stop Pipeline Execution: Stops the current Pipeline execution if the Snap encounters an error.

  • Discard Error Data and Continue: Ignores the error, discards that record, and continues with the remaining records.

  • Route Error Data to Error View: Routes the error data to an error view without stopping the Snap execution.

Learn more about Error handling in Pipelines.

Snap Settings

  • Asterisk ( * ): Indicates a mandatory field.

  • Suggestion icon (): Indicates a list that is dynamically populated based on the configuration.

  • Expression icon ( ): Indicates the value is an expression (if enabled) or a static value (if disabled). Learn more about Using Expressions in SnapLogic.

  • Add icon ( ): Indicates that you can add fields in the fieldset.

  • Remove icon (): Indicates that you can remove fields from the fieldset.

Field Name

Field Type

Description

Field Name

Field Type

Description

Label*

 

Default ValueGoogle Sheets Subscribe
ExampleSubscribe Accounts

String

Specify a unique name for the Snap.

 

Include Shared Drives

 

Default Value: Deselected
Example: Selected

Checkbox

Select this checkbox to include files from the shared drive.

Deselect this checkbox to exclude files from the shared drive.

This Snap does not support Shared Drive or other Drives—it supports only My Drive.

Display Spreadsheet ID in Suggestions

 

Default Value: Deselected
Example: Selected

Checkbox

Select this checkbox to display Spreadsheets ID with the Spreadsheet name in the Spreadsheets Suggestions list.

Spreadsheet

 

Default value: N/A
Example: My Google Sheet

String/Expression/Suggestion

Specify or select the spreadsheet name or ID (or both) containing the worksheet to be subscribed to.

Webhook URL

Default value: N/A
Example: https://snap.elastic.snaplogicdev.com/api/1/rest/slsched/feed/QA/AccountValidation/shared/Test_PipelineyPHNzSUAvY7pUxZhjei35rgkCJ87gzzr

 

String/Expression

Specify the Webhook URL to allow Google to send notifications.

Webhook URL is similar to Target URL. To get a target URL, you must create a triggered task. Learn more about Creating a Triggered Task and Running a Triggered Task.

Watch the video for more information about how to obtain Webhook URL.

Channel ID

Default value: Math.randomUUID()
Example: Math.randomUUID()

String/Expression

Specify a UUID or similar unique string that identifies the channel.

Expiration (in Minutes)

Default value: 60
Example: 40

Integer/Expression

Specify the time in minutes after which the subscription expires.

Snap Execution

Default ValueValidate & Execute
Example: Execute only

Dropdown list

Select one of the following three modes in which the Snap executes:

  • Validate & Execute: Performs limited execution of the Snap, and generates a data preview during Pipeline validation. Subsequently, performs full execution of the Snap (unlimited records) during Pipeline runtime.

  • Execute only: Performs full execution of the Snap during Pipeline execution without generating preview data.

  • Disabled: Disables the Snap and all Snaps that are downstream from it.

Example

Subscribing and Unsubscribing to a Google Spreadsheet

This example Pipeline demonstrates how to subscribe to and unsubscribe from a spreadsheet using Google Sheets Subscribe and Unsubscribe Snaps.

First, configure the Google Sheets Subscribe Snap to subscribe to the new spreadsheet for update notifications. Specify the following details:

  • Spreadsheet: The spreadsheet name to subscribe.

  • Webhook URL: The target URL to which the notifications should be delivered.

  • Channel ID: The ID of the channel to which the spreadsheet belongs.

  • Expiration: The expiration time for the subscription with the resource ID.

The following image shows how to do this configuration and the resulting output:

 


Next, configure the Mapper Snap to extract the $id and $resourceId:


Finally, configure the Google Sheet Unsubscribe Snap to unsubscribe the spreadsheet as shown.

 

Download this Pipeline.

Video Demonstration

The following video demonstrates how to obtain Webhook URL.

Downloads

 


Related Content