20min

Google Sheets + Offline Plugin

Introduction

This API allows reading and writing data to google sheets of any authenticated user. Once user allowed access to their sheets the token will not get expired and will keep renewing automatically.

Google Sheets API

Prerequisites

For using the plugin you'll need to get the API credentials for Google Sheets. Go to https://console.developers.google.com and enable the Google Sheets API ✅

Document image



After you've enabled the Google Sheets API, access the it by clicking Manage where you'll create your credentials for the application.

Document image



Click on Create Credentials to access the credentials creation API Key and App Secret

Note: OAuth 2.0 authentication type is used in Plugin Demo setup.

Document image
Document image



OAuth Credentials setting

Document image
Document image



Bubble Plugins Setup

After you've installed the plugin in app set your API keys from Google:

Document image



Document image

​1. Create an authorization Event on your page for your Sheets.

Document image



2. Authorize your Google Sheets account and grant access.

Document image
Document image



Handy to know:

  • Its worth noting that Spreadsheet ID', Sheet ID' & Sheet Names are referenced throughout this plugin and they stand for different things. eg. A spreadsheet has an ID like so,_ 1PciD2dkT3IJTuIJ0484XjdoalxBfSXStkL3sFpIYj4QT, each sheet inside the spreadsheet also has an id. This ID ranges in its value but usually the default first page in the spreadsheet will have the number 0 as its ID. Common ID's after the initial sheet will often look like this, 241376695. The other identifiable property is a sheets name, this can be the title you assigned it or something like this, Sheet0.
  • Keep in mind that some action's require one of these or a mix of these.

3. Working with Google Sheets after authorization.

  • Use Read Sheets Value action to display a sheet on page:
Document image



  • Use Update Row action to update a row in a sheet with new values:
Document image



  • Use Append Rows To a Sheet action to append the rows in sheet with new values:
Document image



  • Use Delete Rows (for columns deletion use Delete Columns action) action to delete entire row of a sheet:
Document image



Available Actions

API Action:

  • Google Sheets + Offline - Append Rows To a Sheet
  • Google Sheets + Offline - Update Row
  • Google Sheets + Offline - Clear Range of Values
  • Google Sheets + Offline - Delete Rows
  • Google Sheets + Offline - Delete Columns
  • Google Sheets + Offline - Insert Empty Row
  • Google Sheets + Offline - Insert Empty Column
  • Google Sheets + Offline - Read Sheet Values

Demo to preview the settings