Update custom form in real-time

Google Apps Script
Dynamic survey form 2
  • Key highlights

  • Built a Google Apps Script web app to display custom form
  • Web app captures form responses and updates the UI with a dynamic question based on prior responses
  • Web app stores all user information in a Google Sheet

Summary

The client needed to display a series of survey questions, and then present the user with a followup question that is determined in real-time, using prior survey submissions. I developed a Google Apps Script web app to capture responses, search for best match response, display that to the user, and record all the user's answers in the sheet.

Custom survey form

I developed a Google Apps Script web app that rendered a custom form, matching the look-and-feel of the customer's website.

The web app included the HTML, CSS, and Javascript of the custom form.

Form 1
Form submissions

Real-time response calculation

When the user submits the initial form, the Google Apps Script web app captures the user responses.

It then scans the Google Sheet that contains prior responses and, using an algorithm, identifies a prior response that is closest to the user's own response.

Real-time survey modification

Finally, my Google Apps Script retrieves the text response from the best matching submission and displays it to the user.

The user then submits to what extent he or she agrees that the chosen text matches their own sentiment.

The Google Apps Script web app records all of the user's responses in the Google Sheet.

Form 2
Technologies and libraries in project
Google Apps Script
Web app
Google Spreadsheet Service
eslint
prettier