Integrating Google Forms using Zoho Flow

Integrating Google Forms using Zoho Flow

Google Forms has become a popular web-form tool for collecting contacts, surveys, and quizzes. Creating a form and consolidating the responses in a spreadsheet is a straightforward process and takes only a few minutes. However, what if you need to use the collected data more effectively, for tasks such as sending automated emails for each new response, notifying your team in Slack, and adding leads to your CRM application?

Manually converting your form's responses into useful tasks is a waste of your valuable time. With automation, your workflow can detect a form submission, decide what to do with the response data, and distribute it to the apps of your choice. The possibilities are endless.


How do you automate such workflows?

Workflow automation can be implemented in many ways. Using code is one way of achieving it, but this can be tricky for most practical applications. A workflow automation platform like Zoho Flow can be incredibly useful in circumventing this. It allows you to automate tasks by integrating your favorite apps, controlling and manipulating data that flows between them.

For example, every time a form submission is made, Flow will automatically take in the response and move it to other apps, such as Slack, Zoho CRM, or ActiveCampaign. Let's take a look at how this can be achieved.

Generally, all you need to do is to create a new flow, select a trigger, and then add actions. However, some applications, such as Google Forms, do not provide public API for integrations. To integrate applications for which APIs are not available, or if there are limitations to the available APIs, you can use the webhook trigger available in Zoho Flow to achieve the same results.

What you will need

  • A Google account
  • A Zoho Flow account

Getting started: Creating your Google Form

Once you have logged in to your Google account, you can go to docs.google.com/forms to start creating your new form. Even better, you can create a sheet in Google Sheets, click on Tools > Create a form to create one. All the responses that it collects get saved automatically in that spreadsheet.

Work with the title, form fields, and other options to create the form that you would like to use. 

Adding a Form Project: Google Forms Script editor

  1. Navigate to the More menu (the 3 dots) on the top right corner, adjacent to the SEND button. Click Script editor. This will open a new tab containing a console.

  2. Clear the existing contents in that console and copy the following content into it.
     
    
    function onFormSubmit(form) {
    	var formResponses = form.response.getItemResponses();
    	var responsePayload = new Object();
    	for (var i = 0; i < formResponses.length; i++) {
    		responsePayload[form.response.getItemResponses()[i].getItem().getTitle()] = form.response.getItemResponses()[i].getResponse();
    	}
    	console.log(responsePayload);
    	var url = "WEBHOOK URL";
    	var options = {
    		"method": "post",
    		"headers": {},
    		"payload": responsePayload
    	};
    	var response = UrlFetchApp.fetch(url, options);
    }
    
    



  3. Save your project by clicking the Save button.
  4. Navigate to the left panel, then click Triggers


  5. Click Add Trigger. In the follow dialog box, select the Event type as On form submit, then click SAVE.



  6. You will be asked to select your Google account. Since you are inserting a code, it will ask you to proceed only if you trust the developer. Do not worry. Click Advanced, then click Go to <your project>.

  7. Click Allow in the next step.

Adding automation : Using Zoho Flow's Webhook trigger

A trigger in Flow refers to an event that activates your flow. In this case, the trigger will be a webhook. The webhook trigger in Zoho Flow generates a unique URL, which can be used in third party applications (like Google Forms in this scenario) to send data to Flow in real time whenever a form submission has been made. Once the data reaches Flow, you can move it to other applications of your choice.

Setting up the trigger

To set up a webhook trigger, follow these steps:

  1. Log in to Zoho Flow in a new tab and create a new flow.
  2. Click Configure in the webhook trigger box.

  3. Copy the generated URL from the configuration window that opens, then click NEXT.

  4. Go back to Google Forms Script editor tab and replace WEBHOOK URL with the copied URL within the quotes. Do not remove the quotes.

  5. Navigate to File Save.
  6. Return to Zoho Flow and click TEST. You have the option of making a sample form submission to test if it is working perfectly. Click DONE.

  7. Connect actions or decisions to the Webhook trigger in the Flow Builder. All responses in your form will be available as Variables in the INSERT VARIABLE panel.