Site icon Glific

Using Google Apps Script to Automate Glific Flows

Google Apps Script can be used to automate several flow related tasks in Glific, such as creating flows, triggering flows, and deleting flows based on specific requirements.

This blog covers two use cases where Apps Script was implemented with Glific:

The two use cases are different, but both demonstrate how Apps Script can connect Glific with external data sources such as Google Sheets and automate repetitive tasks.


1. Apps Script for Flow Creation and Deletion – ABBF

Flows in Glific can normally be created through the flow editor or by importing a flow JSON. However, the ABBF use case required a different approach.

Context

Requirement

Challenge

Solution

Apps Script uses this information to automatically manage the flow:

Flows will be deleted automatically on the event’s close date, and the details of the deleted flows will be stored in a separate tab within the same Google Sheet.


2. Apps Script for Flow Triggering – Gyan Prakash Foundation

Glific provides a Trigger Flow functionality that allows flows to be triggered for users. For the Gyan Prakash Foundation project, Apps Script was used to automate this process based on attendance data maintained outside Glific.

Context

There are more than 1,000 Sevikas, managed across four District Coordinators, making manual processing of this attendance data difficult.

Requirement

The Gyan Prakash team wanted to send a message to Sevikas who attended the monthly orientation.

The message is used to:

This process needs to happen every month based on the attendance recorded by the District Coordinators.

Challenge

Solution

The sheet below is used by the district coordinators to mark attendance.


We also explored another use case for Gyan Prakash: using Apps Script to create a web app form for recording parent attendance during Monthly Parent Sessions.

The proposed workflow is:

  1. Parents attend the Monthly Parent Session.
  2. Their attendance is recorded through a web app form.
  3. The attendance data is stored in a Google Sheet.
  4. Apps Script identifies the parents who attended.
  5. A Glific flow is triggered for those parents.

This approach can help connect attendance data collected outside Glific with automated communication through Glific.


How to Add Apps Script

You can add Apps Script directly to the Google Sheet used for the workflow.

Step 1: Open the Google Sheet

Step 2: Open Apps Script

Step 3: Add the Script

Step 4: Run and Test

Note: The first time you run the script, Google may ask you to grant the required permissions.

Step 5: Set Up the Trigger


Try It Yourself

To experiment with similar use cases, you can use the Apps Script Generator to generate the required script based on your use case.

Note: This tool generates scripts only for the use cases mentioned above.

Exit mobile version