$ show jamiewilson/form-to-google-sheets
This repository provides a complete, minimal example of how to submit an HTML form to Google Sheets using Google Apps Script as a serverless backend. The core is a Google Apps Script (form-script.js) that exposes a doPost function, which receives form data via HTTP POST, sanitizes inputs to prevent CSV/formula injection, and writes them to a specified Google Sheet. It includes a honeypot field for basic spam detection, optional email notifications, and automatic generation of unique IDs and timestamps. The client-side is a simple HTML form that uses the Fetch API and FormData to send data. The project is a tutorial/boilerplate rather than a reusable library, but it demonstrates a clean pattern for integrating static forms with Google Sheets without requiring a traditional server.
The LLM identified 1 files worth highlighting for reuse:
The sanitizeValue function is a self-contained utility that prevents CSV/Formula injection by prepending a single quote to any string value that starts with '=', '+', '-', or '@'. This is a common security pattern for Google Sheets integrations and can be extracted and reused in any Google Apps Script project that writes user input to a spreadsheet.