Blog
Easily Master SurveyCake Google Sheets Integration

Easily Master SurveyCake Google Sheets Integration

SurveyCake 品牌標誌。
SurveyCake Blog
January 16, 2023
Easily Master SurveyCake Google Sheets Integration

Unlock the full potential of your SurveyCake with Google Sheets Integration!

Surveys are a powerful tool for collecting data and insights. But what do you do with all that data once you have it?

With Google Sheets, you can easily store, analyze, and share your survey results. This gives you the power to make better decisions, improve your products and services, and grow your business.

In this blog post, we’ll show you how to connect your surveys to Google Sheets. Once you’ve done this, you’ll be able to:

  • Store your survey results in a single sheet
  • Analyze your data using Google Sheets’ powerful tools
  • Share your results with others

Step by step guide

1. Create a Google Spreadsheet
2. Set up the Google Spreadsheet App Script
3. Set up the SurveyCake Webhook Url
4. Test-submit twice

1. Create a Google Spreadsheet

To get started, you’ll need to create a survey using SurveyCake, obviously. Next, you’ll need to create a Google Sheets spreadsheet to store your survey results.

2. Set up the Google Spreadsheet App Script

To connect your survey to Google Sheets, you’ll need to set up a script.

2-1. Copy a prebuilt app script

Now, you need to copy the script that will connect your survey to Google Sheets. Click HERE and this will open a new tab with the code. Select ALL of the code and copy it.

Decrypt library script fully selected in a code tab, opening comment listing four crypto-js CDN URLs

2-2. Go back to your Spreadsheet and click Extensions > Apps Script.

Untitled spreadsheet with the Extensions menu open and Apps Script highlighted above Macros and AppSheet

2-3. Paste the chunk of script you just copied

Delete ALL default script first.

Apps Script editor with the default empty myFunction code boxed in red and labelled Delete ALL

Then paste the chunk of script you just copied from HERE.

Pasted decrypt script filling Code.gs, starting with the crypto-js library comment block at line 1

2-4. Go back to SurveyCake admin panel

Go to Notification > Webhook to find the Hash key & IV key of your survey.

SurveyCake Notification and Webhook page, red arrows pointing at the masked Hash key and IV key fields

2-5. Replace the Hash key & IV key in the App Script

Now go back to your App Script. At row 38 & 39 you’ll find YOUR_SURVEY_HASH_KEY & YOUR_SURVEY_IV_KEY. Please replace the two parameters into the actual Hash Key & IV Key from your survey.

*P.S. Please do not delete the quotation mark. Please replace the text within quotation mark only.

Apps Script lines 38 and 39 highlighted, holding the YOUR_SURVEY_HASH_KEY and YOUR_SURVEY_IV_KEY placeholders

2-6. Click Save & Run

It’s important to click Save > Run by this order.

Keys replaced with sample strings on lines 38 and 39, cursor on the toolbar Save project icon
Run button with a Run the selected function tooltip, returnResponse chosen in the function dropdown

You may need to authorize your Google account during the process.

Google sign-in dialog asking to pick a 25sprout.com account to continue, with a use another account option

2-7. Deploy

  • Select Deploy > New deployment
  • Click the gear icon on the left, choose “Web App.”
Deploy dropdown open in Apps Script, listing New deployment, Manage deployments and Test deployments
New deployment dialog with the type gear menu open, offering Web app, API Executable, Add-on and Library
  • Set “Execute as” to your Google account and “Who has access” to “Anyone.”
  • Click the “Deploy” button.
  • Once authorized, you’ll get a URL. Please copy that URL.
Web app deployment configuration with Execute as set to Me and Who has access set to Anyone
Deployment successfully updated dialog showing Version 1 and the web app URL, with Copy boxed in red

3. Set Up Survey Webhook URL

3-1. Paste the Webhook URL and click “Save.”

Go back to the Webhook page in SurveyCake admin panel (step 2-4). Paste the copied URL in the “Webhook URL” section (step 2-7).

* Don’t forget to click the save button in the top right corner; otherwise, the webhook URL won’t be saved!

SurveyCake Webhook page with a script.google.com macro URL pasted into Webhook URL beside the green Save button

4. Test by Responding Twice

4-1. Test-submit your survey for the first time.

You’ll see the 2 rows of headers created in the Spreadsheet.

4-2. Test-submit the survey again

After the second submission, your Spreadsheet will be updated with the latest response.

Response spreadsheet with a numeric row 1, question-text row 2, and submissions from Judy and Debby

Notice

  1. DO NOT manually modifying rows 1 and 2 in the spreadsheet. These are used as the system identification.
  2. If you edit the survey after the integration, the spreadsheet will adapt to the new question order. Deleted questions will move to the end.
  3. There might be a time-lag in the response timestamp between Google Sheets and SurveyCake due to the automatic adjustment of the webhook’s time zone. Users may need to manually adjust the time difference in Google Sheets.

【Usage Scenario: Resume Collection】

Departments within a company can efficiently collect resumes using a survey form. By integrating the survey form with Google Sheets, survey responses are automatically imported. This facilitates collaborative viewing and editing among colleagues. Each team member can easily review all applicants’ resumes and provide feedback. Supervisors can even tag candidates for interview stages, streamlining HR operations.

Columns O to Q appended to the sheet, two colleagues leaving notes and yellow V marks flagging interviews

No amount of tutorials beats hands-on experience!

The steps to integrate survey responses into Google Sheets are outlined in this article.

Feel free to create a survey and try the integration yourself. You’ll discover that the process is simpler than you imagined, even for those who have no programming experience.

Click here to sign up for FREE!

SurveyCake Blog
SurveyCake is a cloud-based survey platform developed in Taiwan. Stay tuned to our blog for the latest news and survey-related content. You are also welcome to share our posts with your friends by crediting us. If you have any questions, you can find us at the following places:

Further reading

Start surveying today.

Powerful question types. Advanced analytics. Built for serious work.
Create for free