How to Submit an HTML Form to Google Sheets…without Google Forms

David McCoy
5 min readJun 10, 2017

Google Forms is a great service. Easy, good-looking forms with results stored in Google Sheets. But what if you don’t want your form to look like a Google Form? How can you build your own HTML form and record the responses in Google Sheets?

The answer is surprisingly tricky. One would think that Google Forms would have an API to receive AJAX requests but, alas, that is not that case. So we’ll cut out the Google Forms middleman and submit our AJAX requests directly to Google Sheets.

Setting up the Google Sheet

Since we’re skipping Google Forms, head straight to Google Sheets and create a new spreadsheet. The only thing we’ll need to do to the spreadsheet itself is assign column names for each form field we’ll be collecting.

Place the names of each form field in row 1. The order isn’t important, but the name of the cell in the spreadsheet must match the name of the form input. It’s case-sensitive, so choose your names carefully!

Configuring the Google Script

--

--

David McCoy

Expat. Web developer. Owner of Hipsters of the Coast.