explaingit

jamiewilson/form-to-google-sheets

4,738JavaScriptAudience · vibe coderComplexity · 2/5Setup · moderate

TLDR

A guide and code snippet for saving HTML form submissions directly into a Google Sheet using a small Google Apps Script, with no backend server or database needed.

Mindmap

mindmap
  root((form-to-google-sheets))
    How it works
      HTML form
      Google Apps Script
      Google Sheet rows
    Fields captured
      Unique ID
      Timestamp
      Custom form fields
    Security features
      Honeypot bot trap
      Formula injection block
      Email notifications
    Requirements
      Google account
      Static HTML page
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a contact form to a static website that saves every submission to a Google Sheet you control

USE CASE 2

Build a newsletter signup form that collects emails without a database or paid service

USE CASE 3

Create a simple survey where responses appear as rows in a shared spreadsheet your team can view

USE CASE 4

Get email alerts whenever someone submits your web form

Tech stack

JavaScriptGoogle Apps ScriptHTML

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a Google account and manually deploying a Google Apps Script web app from the Google Script editor.

License not specified in the explanation.

In plain English

This project is a guide and code snippet for collecting HTML form submissions directly into a Google Sheet, without needing a backend server. When someone fills out and submits a form on your website, the data lands in a spreadsheet you control, visible in rows and columns like any other Google Sheet entry. The setup involves three moving parts: a Google Sheet to receive data, a small script that runs inside Google (called a Google Apps Script), and a few lines of JavaScript added to your existing HTML page. The script acts as a middleman: it lives on Google's servers and listens for form submissions, then writes each one into a new row of your spreadsheet. You deploy it as a web app and connect your form to its URL. Each submission automatically records a unique ID, a timestamp, and any form fields you've named to match column headers in the sheet. To add more fields like a phone number or message, you create the matching column in the sheet and add the input to your HTML form. The column name must match the form input's name attribute exactly. The README also covers some security basics: a honeypot field to catch bots, input sanitization in the server-side script to block formula injection attacks, and optional email notifications whenever a new submission arrives. There is no database to maintain, no server to host, and no login system to build, which makes this approach attractive for simple contact forms, newsletter signups, or survey responses. The project uses plain JavaScript fetch to send the form data and a Google Apps Script to receive it. It works with any HTML form and requires only a Google account to set up.

Copy-paste prompts

Prompt 1
Set up the form-to-google-sheets script for my HTML contact form with name, email, and message fields, and walk me through deploying the Google Apps Script
Prompt 2
Help me add a honeypot anti-spam field to my form-to-google-sheets setup to block automated bot submissions
Prompt 3
My form submissions aren't appearing in my Google Sheet, help me debug by checking whether the column names match my input name attributes
Prompt 4
Add email notifications to my Google Apps Script so I get alerted whenever a new form submission arrives
Prompt 5
I want to add a phone number field to my form, explain exactly what I need to change in both the HTML and the Google Sheet
Open on GitHub → Explain another repo

← jamiewilson on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.