Sending data to Google Sheets using HTML

A simple guide to building a HTML form and sending the data to Google Sheets with Sheet Monkey

All these guides require that you have a free Sheet Monkey account. If you haven't registered your account, please do that before continuing.

Picking a Google Sheet

Because Sheet Monkey automatically builds the columns, it may be easiest to start with a blank sheet if you already have a form and just want to connect it to a sheet. But if you're looking for something to help you get started, you can pick one of our templates. Sheet Monkey will automatically save the sheet with some initial columns in your Google Drive.

Once you create a form, Sheet Monkey will provide a form url or "form action" where you can start posting data. This unique action is all you need to post data into the Google Sheet.

Because form actions function like a one-way write key to your Google Sheet, we recommend that you only post them on your site when you're ready for data to start coming into the sheet. If you need to disable saving data into your sheet, you must delete the form in Sheet Monkey.

Mapping the form fields to your sheet columns

Always follow the Three Rules of Sheet Monkey when building your HTML form and mapping the form fields to the columns. If you picked one of our templates, Sheet Monkey provides some starter HTML for your form. Feel free to modify this HTML as much as you want.

Here's an example mailing list form that Sheet Monkey built:

<form action="https://api.sheetmonkey.io/form/vB1pUYCBvUqnSarEvAgsd6" method="post">
  <label>Your Name: <input type="text" name="Name" required /></label>
  <label>Your Email: <input type="email" name="Email" required /></label>
  <input type="hidden" name="Created" value="x-sheetmonkey-current-date-time" />
  <input type="submit" value="Sign Up" />
</form>

Once you submit this form, the data will appear in the linked sheet like this:

Special form fields

Sheet Monkey has a few "special fields" that make saving certain common types of data easier.

Saving a current date and time:

Create a hidden field with a value of x-sheetmonkey-current-date-time and Sheet Monkey will automatically convert that value to a date and time in your Google Sheet.

<input type="hidden" name="Created" value="x-sheetmonkey-current-date-time" />

Saving a current date:

Create a hidden field with a value of x-sheetmonkey-current-date and Sheet Monkey will automatically convert that value to a date in your Google Sheet.

Redirecting after the form is submitted

Once a visitor to your website has successfully submitted a form, you often want to redirect them to another location. Sheet Monkey allows you to do this with the x-sheetmonkey-redirect field. Put any URL into this field and the user will be automatically redirected to that URL after submitting your form.

<input 
    type="hidden" 
    name="x-sheetmonkey-redirect" 
    value="https://my-site.com/signup-success.html" 
/>

This special reserved field will not be added to your spreadsheet as a column.

Limiting what websites can submit to your form

Sheet Monkey allows you to limit the domains that can submit to your form with the "Domains" field. If you want to allow submissions from all locations leave this field blank or enter the * wildcard character.

Last updated