Tuesday, 18 November 2025

Google Form - cleanse question titles

The following Google Apps Script provides a way to help clean data submitted by a Google Form (via an 'onFormSubmit' trigger), specifically the question titles. We typically use the question titles in our Apps Script code to extract the specific values we want e.g. email address, name, etc. Doing so locks us into ensuring we copy the relevant question title explicitly as it is written in the Form, such as any upper/lower case characters and trailing whitespace. Any deviation from this and the automation will no longer work.

This specific piece of Apps Script has been created so that it can be easily dropped into the beginning of your existing code, to set the Form question titles all to lowercase and to remove any whitespace around them.

Google Form - cleanse question titles sample code