Digital marketing news and insights, case studies and thought leadership

Google Sheets API - Publishing HTML Form Data to a Google Sheet

Google Sheets can be a useful tool for collaboration between team members, but did you know that you can also add, edit and update content in a Google Sheet from your website or application? The Google Sheets API provides a variety of methods to interact with a sheet, and here we'll explore one of these methods step-by-step.

After configuring and enabling the Google Sheets API, we'll use the 'sheets.spreadsheets.values.append' method to publish a new row to a Google Sheet through an HTML form. To complete this project, you'll need a Google Account and a solid foundation in HTML, Javascript and PHP.

The video will walk you though the following tasks:

  1. Creating a New Project in the Google Developers Console
  2. Enabling the Google Sheets API
  3. Configuring credentials to access the API
  4. Using the Google API Explorer to create and test a sample request
  5. OAuth Credentials - Obtaining an Authorization Code, Access Token and Refresh Token (PHP)
  6. Handling the HTML form data (Javascript)
  7. Exchanging an OAuth Refresh Token for a fresh Access Token (Javascript)
  8. Calling the Google Sheets API method to post form data to the sheet (Javascript)


Google Developers Console

Google Sheets API Method Reference

Google API Explorer

Download Sample Code:

If you're interested in working with the Snyder Group on a Google API development project, we're here to help. Request a Consultation »