功能指南
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.

整段反白選取的 CryptoJS 解密程式碼,開頭註解列出四個 cloudflare 函式庫網址

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

空白 Google 試算表展開 Extensions 選單,游標停在其中的 Apps Script 項目上

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

Delete ALL default script first.

Apps Script 編輯器裡預設的 myFunction 程式碼被紅框圈起,旁邊註明 Delete ALL

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

Apps Script 編輯器貼上大段解密程式碼後的畫面,開頭是載入函式庫的註解區塊


2-4. Go back to SurveyCake admin panel

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

SurveyCake 後台 Notification 的 Webhook 頁,紅色箭頭指向框起的 Hash key 與 IV key

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 程式碼第 38、39 行反白,顯示待替換的 YOUR_SURVEY_HASH_KEY 與 YOUR_SURVEY_IV_KEY

2-6. Click Save & Run

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

金鑰已替換成範例字串,游標停在工具列存檔圖示上並顯示 Save project 提示工具列的 Run 按鈕出現 Run the selected function 提示,右側函式選單為 returnResponse

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

Google 帳戶授權視窗,要求從 25sprout.com 中選擇一個帳戶以繼續使用「專案」

2-7. Deploy

  • Select Deploy > New deployment
  • Click the gear icon on the left, choose “Web App.”
Apps Script 右上角展開 Deploy 選單,列出 New deployment、Manage deployments 與 Test deployments
New deployment 視窗點開齒輪的類型選單,出現 Web app、API Executable、Add-on、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.
部署設定頁的 Execute as 設為自己的帳戶、Who has access 設為 Anyone,右下角是 Deploy 按鈕
部署成功視窗顯示 Version 1 與網頁應用程式網址,網址下方的 Copy 連結被紅框圈起

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 設定頁已填入 script.google.com 開頭的網址,右側列出 Hash key 與 IV key

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.

名為 SurveyCake 串接 Google Sheets 的試算表,前兩列是系統產生的標題,第三、四列為兩筆填答資料

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.

試算表右側自行新增的欄位,主管在同事 John、Cathy 欄填入評語,是否發面試欄標上黃底的 V

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:

延伸閱讀

現在就開始你的問卷調查

多元題型功能與進階資料分析,輕鬆打造最專業的問卷調查
免費建立問卷