Skip to main content

Link Google Sheets


15 minutes readLevel: IntermediateLast Updated: April 2026

The Link Google Sheets action allows you to connect your flows in Glific directly to Google Sheets so you can read, write, and update data in real time.

When to use Read from Google Sheet

Use this when you need to:

  • Send reminders, schedules, or event details stored in a central sheet.

  • Populate lists or menus dynamically from sheet data.

How to set Google Sheet:

  • Google Sheets API is linked with Glific.

  • The service account has Viewer or Editor access to the sheet.

  • The sheet is shared with the service account email.

Add Readable Google Sheet

  1. Log in to your Glific account.

  2. Click on Flows from the left panel and find Google sheets

  3. Click on +Create button to add a sheet to read from

Screenshot 2024-02-29 at 1 35 52 PM
  1. Add the Sheet URL and Name of the sheet which you want to integrate. Check the Read checkbox and Click on theSave button. Follow next steps to get the URL
Screenshot 2024-02-29 at 1 38 46 PM
  1. Open the Google Sheet and click on the share button on the top right. Add the service account email (from the JSON key) and grant the required access—Viewer (read-only) or Editor (read/write).

Alternatively, if you prefer not to add the service account email, you can change the sheet persmission to “Anyone with the link can view.”

  1. Copy the URL

image

  1. Paste the copied URL in the Google Sheet Integration screen in Glific and click on SAVE button

  2. You can click on the link button to open the added sheet

Screenshot 2024-02-29 at 1 42 44 PM
  • It is important to note that the first cell in the Sheet should be named as 'Key' for the Read function to work.

Examples

  • Daily Reminders: Match today’s date to a schedule column and send the corresponding message.

  • User Lookup: Pull registration details based on phone number or ID.

  • Dynamic Menu: Read items from a sheet and send them as interactive list options.

Google Sheet Sync

  • When content to a linked google sheet in read mode is updated, the sheet needs to be synced using the sync button corresponding to the google sheet.
  • This ensures that the latest modifications made in the google sheet are available to use in the Glific flows where the sheet is being used.
  • Google sheet in read-mode and on auto-sync functionality sync every 24 hours. The google sync operations happen between 5-6am IST
  • To handle use case which demand that the google sheets be synced more than once a day or as per a custom logic, read more here
  • If the google sheet fails to sync, the flow continues to send older content.
  • To troubleshoot sheet sync failure errors, read more in FAQ section.

Why to use Write Mode of Google Sheet

Write Mode lets you send data from WhatsApp conversations directly into Google Sheets, removing the need for manual entry and ensuring immediate updates.

When to use Write Mode

  • Use this when you need to:
  • Record survey answers in real time.
  • Collect event registrations or sign-ups
  • Track responses, feedback, or status updates.

Configuring Readable Google Sheet in the Flow

1 . Create a new flow and open it for editing

  1. Use link Google sheet node

  2. Select Link google Sheet

  3. In the second drop-down select the sheet

  4. In Select row add any variable that uniquely defines the Key column of the linked Google sheet

Screenshot 2024-02-29 at 1 47 48 PM

As per above example, the sheet Daily Activity is used to read the content from, and the variable @calendar.current_date DD/MM/YYYY being passed from Glific to the Google sheet is being used as the search key to identify the relevant row to send the content from

Note: It is important to note that dates in the sheet should be in the format DD/MM/YYYY. Any other format will not work as expected. You could either set the Locale in the Google sheet to India or set the format of the column to DD/MM/YYYY here Format -> Number -> Custom Date and Time

These all are the below calendar functions that can be used : @calendar.current_date,@calendar.yesterday,@calendar.tomorrow,@calendar.current_day,@calendar.current_month, @calendar.current_year

To write date and time, use the following expression: <%= DateTime.now!("Asia/Kolkata") |> Calendar.strftime("%Y/%m/%d %H:%M:%S") %>

  1. Click on OK

  2. Use column header like below and access the relevant column of the identified row.

@results.sheet.col_nameA

image

Examples

  • Survey Submission: Write answers to a new row for each participant.
  • Registration Forms: Save participant name, contact number, and event preferences.
  • Attendance Logs: Record check-ins directly into the sheet.

Send template messages using Google Sheets

Template messages could be sent using Google Sheets using Read Google Sheets. This is generally useful when different template messages need to be scheduled & sent regularly to the beneficiaries. Let us dive in a bit deeper by looking at the steps involved :

  1. Create the template messages that you'd like to send via Google Sheets using the normal method. Refer Creating Template Messages

  2. Once the template is created, make note of the UUID of the template messages you need to share using Google Sheets. Refer the screenshot below :

Screenshot 2024-02-29 at 1 58 09 PM
  1. Create a Google Sheet with two headers, Key and template_uuid as shown below. Usually the key column will be having dates on which the individual templates need to be sent. Screenshot 2023-09-15 at 1 25 33 PM
  2. Now let us setup the flow. The flow starts with a Link Google Sheets node which has the Google Sheets we created linked. This is how the node looks like :

Screenshot 2023-09-15 at 1 50 48 PM

As you can see, the row input field is given an expression @calendar.current_date which tries to match the current date value with a Key value. If a match is found, then that row is chosen.

  1. In the next step, Send contact a message is used and an expression is given in place of the template selection drop-down. The expression reads <%= Glific.send_template("@results.sheet.template_uuid", ["@contact.name"] ) %> and if no variables then <%= Glific.send_template("@results.sheet.template_uuid", [] ) %>

In this expression, the template_uuid matching the row in the given date gets send to the user. The expression also passes the value of the contact's name. You can pass multiple variables in this expression, if the template message demands it, using comma separation.

In this way, you can use Google Sheets for sending template messages. With the use of Triggers you'll be able to schedule different template messages for specific dates using Google Sheets, enabling you to do it in a single flow, instead of creating separate flows for separate templates. This is particularly useful, when you plan to share a set of instructions/ advisory/ content in a scheduled manner in specific dates & let's you use dynamic content for the same.

Send Interactive Messages using Google Sheets

Glific enables you to send interactive messages using Google Sheets. This is particularly helpful when you need the options within the interactive messages to be dynamic. This lets you use the same interactive message for creating multiple dynamic list of options to choose from for the beneficiary.

Let's dive in a bit deeper to see how it works.

  1. Create a Google Sheet with the list of options you wish to have in the interactive message in a row as shown below. In this example, we want the values given in row 2 i.e key value as 1 to be used as the options in the interactive message we're going to create. These values could be updated in real-time to change the options inside the interactive message or you can add more rows to have different interactive messages too.
Screenshot 2023-09-19 at 2 12 47 PM
  1. Add the above created Google Sheet on the Glific. Please find the steps to do that here

  2. Now create a sample Interactive Message with a list message (can do similarly for button options too).

  • Please note the first option needs to be entered as shown below with some sample data. This is to ensure the interactive message is created and saved. The list or options will be rewritten by the values on the sheet, hence the rest of the options could be left empty.
Screenshot 2024-02-29 at 2 08 50 PM
  1. Now since we have the Google Sheets linked & the interactive message created, let's create a sample flow to understand how it works :
Screenshot 2023-09-19 at 11 51 38 AM
  1. As you can see, the flow starts with a Link Google Sheets node, where the readable google sheets from which the options to be fetched inside the interactive message is added. This is how the Google Sheets node is configured :
Screenshot 2023-09-19 at 11 53 27 AM
  • In the node above, the sheet we created have been linked & the corresponding action is marked as Read since the options for Interactive Message are being read from the Google Sheets.
  • Here 1 is added in Select row field, as the values for the interactive message are present on the row with the key value as 1 and it is stored under the variable name sheet
  • Instead of 1, you can also use dynamic values like flow variables or contact variables, functions like @calendar.current_date etc.
  1. The next node consists of Send contact an interactive message node and this is how it is configured
Screenshot 2023-09-19 at 2 14 22 PM
  • The interactive message we've created is chosen from the dropdown.
  • The dynamic fields checkbox is selected which enables us to use dynamic values inside the interactive message.
  • In the input field box with number of variables, the number of options in the interactive message needs to be entered. Here we've given 8, since we need 8 options in the list sent (as also shown on google sheets).
  • The id and variable values need to be filled. The id could be any unique value for referencing & variable value is being fetched from the linked Google Sheet.
  • The variable names are filled as @results.sheet.course1, @results.sheet.course2 and so on representing each row value from the row we've chosen to read from.
  1. Now since the flow is configured, let's test the flow
Screenshot 2023-09-19 at 12 07 16 PM

As you can see on the preview above, the list of options we had given in the Google Sheets are shown as a list of options inside the Interactive Message.

  • Sending interactive messages using Google Sheets could avoid the redundancy of creating multiple interactive messages when the list of options needs to be updated (some option needs to be added or removed) or multiple interactive messages to be used.
  • It can also be used for handling situations where the list of options is more than 10 by using 'More' as the tenth option and having a separate list of options in the next row.

Using G-sheets to Dynamically fetch button/list options in Interactive Messages.

This approach helps the user reduce the effort required to create flows containing multiple interactive messages by automatically fetching the message body and options from a Google Sheet.

It is particularly useful in scenarios such as:

  • When multiple interactive messages (for example, more than 4) are used within a chatbot flow.
  • When managing nested options (e.g., District → Block).

The example below demonstrates a sample setup for both approaches, which can be customized or adapted as per the specific use case.

Screenshot 2025-10-09 at 2 31 36 PM
  1. In the nested drill-down approach, once the end user selects a district, the corresponding blocks under that district are displayed.
  2. In the second approach, based on the topic selected (Science or General Knowledge), a short quiz with two questions is presented to the end user. The message body and options for both questions are dynamically fetched from the G-Sheet.

Steps to configure this setup:

Step 1 - Setup the g-sheet, following this format. Here’s the link to the sample sheet

For quiz:

Screenshot 2025-10-09 at 2 33 37 PM

To fetch district options from g-sheets–

Screenshot 2025-10-09 at 2 34 14 PM

To fetch corresponding blocks, associated with the district—

Screenshot 2025-10-09 at 2 34 49 PM

Step 2: Integrate Google Sheet with Glific. For detailed steps on how this is done, please follow this link.

Step 3: Create the following interactive messages from Quick tools Pane:

For quiz -

Screenshot 2025-10-09 at 2 37 02 PM

For district options -

Screenshot 2025-10-09 at 2 37 23 PM

For block options -

Screenshot 2025-10-09 at 2 38 03 PM

Since the options will be fetched dynamically from the G-Sheet, placeholder (dummy) values can be added as options while creating the interactive message(s).

Step4: Configure the flow, following the below mentioned requirements. Here’s the sample flow

For quiz -

  • Since there are two topics, each containing two questions, a counter is initialized with a distinct starting value for each topic. After the first question is sent, the counter increments to fetch the next (and final) question along with its options.
  • Once the counter is updated, a check is performed to confirm whether both questions have been delivered. If yes, the flow ends with a closing message; if not, the second question is sent.
  • For the quiz, a single interactive message can be used, with its message body and options dynamically fetched from the linked G-Sheet.
  • Screenshot 2025-10-09 at 2 43 25 PMScreenshot 2025-10-09 at 2 43 44 PM
  • The Use Dynamic Fields option is enabled, and since only two options need to be shown to the user, the Read Option Limit is set to 2. Corresponding IDs and variable names are configured to fetch the option values from the correct columns in the linked Google Sheet.

For Nested drill down –

  • In the nested drill-down setup, district options are fetched from the linked G-Sheet. Based on the district selected by the end user, the corresponding blocks are presented as a second list for selection.
  • Screenshot 2025-10-09 at 2 46 25 PMScreenshot 2025-10-09 at 2 47 01 PM
  • Sheet1 contains the district options, while Sheet2 contains the block options. Both sheets are configured separately within the flow.
  • To ensure only the blocks associated with the selected district are displayed, the key value in sheet2 is set to @results.district_captured, which stores the district chosen by the end user. In the sheet containing the block values, each district serves as the key for its corresponding block list.
  • Since only the options are being fetched from the linked G-Sheet, two interactive messages with a static message body are used.
  • Screenshot 2025-10-09 at 2 51 24 PM
  • Since the number of blocks varies for each district, an additional column in the linked sheet stores the total number of options for every district. This allows the user to control the Read Options Limit and display only the necessary options. It also reduces effort when more options (up to 10) are added to the list, as only the value of @results.sheet2.length needs to be updated followed by syncing the sheet.

Add Writable Google Sheet

Enable Google Sheet APIs and Add Credentials

  1. Use this wizard to create or select a project in the Google Developers Console. This will automatically turn on the API. Click Continue, then Go to credentials.

  2. On the Add credentials to your project page, create a Service account key.

  3. Select your project name as the service account and choose JSON as the key format. Download the generated JSON file containing the credentials.

  4. Go to your Glific account, click on NGO main account, click Settings and find the menu for Google Sheet.

Screenshot 2024-02-29 at 2 13 36 PM

Paste the service account credentials in the provided field, and click on the Save button.

  1. Go to the Google Sheet screen as mentioned in the above steps.

  2. Click on the +Create button to add a sheet to write to.

Screenshot 2024-02-29 at 1 35 52 PM
  1. Add the Sheet URL and Name of the sheet you want to integrate. Check the Write from drop down and click on the Save button. Refer the following steps to ensure the google sheet has right permission before you get the URL.
Screenshot 2024-02-29 at 2 19 43 PM
  1. Open the Google Sheet you want to write data on and click on the share button on the right-hand side. Update the sheet permissions and add the Service Account Identifier (The client email on the service account) as a user invited in the spreadsheet's Collaboration Settings with Editor permission.
Screenshot 2023-05-18 at 11 23 49 PM
  1. Copy the URL.
Screenshot 2023-05-18 at 11 22 26 PM
  1. Paste the copied URL in the Google Sheet Integration screen in Glific and click on the SAVE button.
Screenshot 2024-02-29 at 2 21 32 PM

Configuring Writable Google Sheet in the Flow

  1. Import the below sample flow from the Flow screen and click on setting icon to configure it.

Sample Flow

Write to Google Sheet.json

  1. Here's how the imported flow would look like
Screenshot 2024-02-29 at 2 40 13 PM
  1. The first node is the Send Message node, which asks the contact for input to be added to the sheet.

  2. The second node is the Wait for Response node with the result name sheet_input. The response from the contact will be saved in this result and can be referenced as @results.sheet_input.

  3. The third node is the Link Google sheet node, used to add the user-entered text into the Google sheet. Click on this node to configure it.

Screenshot 2024-09-25 at 10 53 03 AM
  1. Under Action, select Write from the dropdown menu.
  2. From the next dropdown select the sheet which was added in the earlier step
  3. Specify the name of the subsheet where the content needs to be written
  4. Specify the starting cell to start writing from
Screenshot 2024-09-25 at 10 57 35 AM
  1. Enter the data to be written in the Google sheet under Input data to update in sheet. You can use values like @results.sheet_input, @contact.name, @contact.fields.age, etc. This specifies the values to be written in the subsequent columns in the single row.
Screenshot 2024-09-25 at 11 00 39 AM
  1. After configuring the flow, click on the Preview button located on the top right side of the screen to run the flow in the simulator.

  2. In the simulator, you will see the first message from the Send Message node, which prompts you to enter text.

  3. Type the desired text that you want to see in the sheet, and then press Enter.

Screenshot 2024-02-29 at 2 36 46 PM
  1. This will move the flow forward, and the data will be written to the Google Sheet.

  2. Open the Google Sheet to check the newly inserted data.

Screenshot 2023-05-18 at 11 58 31 PM

Google Sheet Access via Service Account

To ensure sensitive beneficiary data (PII) is protected,avoid linking Google Sheets in Anyone can read or Anyone can read/write modes.

Instead, configure access via the Google Service Account linked to your Glific instance.

1.Open the Google Sheet you want to link.

  1. Click Share → Paste the service account email (from the JSON key) and set the permission to either Viewer (read-only) or Editor (read/write).
  2. Link Sheet in Glific
  3. Now the sheet will be access via the service account, respecting the permissions set.
image

Note

  • This functionality can be used to write upto 30 columns in google sheets
  • To handle blank cells in between the Google Sheet use Split by Expression

Advanced Feature Webinar