Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
A guide for submitting HTML forms to Google Sheets via Google Apps Script, updated for the 2026 Script Editor.
HTML Form To Google Sheets is a free, copy-paste guide for building a mailing-list or contact form that posts submissions directly into a Google Sheet using Google Apps Script as a hidden web-app endpoint; it requires no backend server and works with any plain HTML page.
HTML Form To Google Sheets connects a plain HTML form to a Google Sheet by using Google Apps Script as the only intermediary. You paste the provided script into the Apps Script editor, run a one-time initialSetup function, deploy the script as a web app, and set the generated /exec URL as your form's action. The script reads POST parameters, matches them against the sheet's header row, and appends a new row with the current timestamp in the Date column. It is derived from the GitHub project jamiewilson/form-to-google-sheets and updated for the 2026 Script Editor layout.
name attributes must match the headers exactly.doPost function wraps writes in LockService and uses try/finally to avoid concurrent submissions overwriting each other./exec URL and the /dev URL from Test deployments for quick iteration.ContentService JSON indicating success or error, which you can use in an AJAX handler.fetch.Email and Name fields into a Sheet, then use the Sheet as a source for a Mailchimp or MailerLite import.The tutorial walks through five steps: create a Sheet with headers, open Extensions → Apps Script, replace the default function with the provided script, run initialSetup once to save the spreadsheet ID to script properties, then deploy as a web app with "Execute as: Me" and "Who has access: Anyone". Afterward, copy the /exec URL into your form's action and set method="POST"; each submission appends a row. For testing, use the /dev URL from Test deployments. The script uses SpreadsheetApp to find the sheet named Sheet1 and writes at getLastRow() + 1.
The script builds each new row by mapping the sheet's header values and looking up e.parameter[header] from the POST request. If the name attribute in the HTML doesn't match the header casing, the value will be undefined and the cell will be empty. The guide explicitly calls out case sensitivity.
Because your Apps Script has not been reviewed by Google, the authorization screen shows an "Unsafe" warning. Clicking "Go to Mailing List (Unsafe)" is expected: it simply grants the script permission to access the current spreadsheet and write rows.
Yes. The page includes a link to a CodePen example that attaches a JavaScript event listener to the form's submit event, prevents the default browser navigation, and sends the request yourself. This also lets you show a success message on the same page.
The guide is updated for the 2026 version of the Google Script Editor, where the deployment flow is under Deploy → New deployment and you must click "Enable deployment types settings" to choose Web app.
Yes, the page suggests Sheet Monkey, a free service that lets you submit forms to Google Sheets without writing any Apps Script code.
