Skip to content

Playing around with the Google Sheets API: using a GCF to create a sheet & write values to cells.

Notifications You must be signed in to change notification settings

madamCS/GoogleSheetsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Automatically create a Google Spreadsheet when user signs in.

Use client/server relationships and GCF to create a new Google Spreadsheet.

Last updated: July, 2019

This solution uses Google Cloud Functions to automatically create a new Google Spreadsheet in the end-user's account, when the end-user signs in. The client (JavaScript in HTML) obtains end-user authentication & sends it in as a parameter of a 'POST' request to the server (GCF written in Node.js). The server then makes a call to the Google Sheets API, creates a new Spreadsheet, and sends back its URL to the client. Lastly, the client displays the sheet's URL as a link to the end-user.

Technology highlights

  • The client makes a 'POST' request to the Google Cloud Function, securely sending an authorization parameter.
  • The server makes a call to the Google Sheets API.
  • The client deals with the GCF's response, and displays it appropriately.

Try it

First, set up Google Calendar:

  1. Open [Google Calendar][calendar] in your browser.
  2. [Create a new calendar][calendar_setup] called "Team Vacations".
  3. Still in the settings screen, select the new calendar from the left menu.
  4. Scroll to Integrate calendar and copy the value under Calendar ID.

You can view the corresponding blog post where I discuss client/ server relationships.

About

Playing around with the Google Sheets API: using a GCF to create a sheet & write values to cells.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published