Google Sheets – Setup

Introduction

This guide takes you through setting up Google Sheets for use with Cyclr, as well as installing a Google Sheets Connector.

You will need a Google Cloud Platform account.

Setup & authentication

Overview

The Google Sheets Connector supports 2 Authentication Types, which are explained in this guide:

  • OAuth2 – requires user interaction to install the Connector.
  • Service Account – impersonates a domain account and requires less user interaction.

Remote setup in Google Cloud Console – performed by Cyclr Partner

Depending on the Authentication Type you choose, the setup is slightly different after following the initial “Common Setup” below:

Common Setup – Enabling the Google Sheets API

Both Authentication Types require the following setup to be performed.

To access the Google Sheets API endpoints, you need to enable the “Google Sheets API” within the project in your Google workspace. Google’s documentation on how to do this can be found here.

Then skip to the appropriate section below:

OAuth2 – remote setup

To authenticate the Connector using the “OAuth 2.0 Authorization Code” Authentication Type, you need to create a web application inside your Google Cloud Platform account to get your OAuth 2.0 credentials:

  1. From the Google Cloud Platform Credentials page, select CREATE CREDENTIALS > OAuth client ID. Create a project with the following settings:
SettingValue
Application typeWeb application
Authorised redirect URIsA URL containing your Cyclr Service Domain. This can be found under Settings > General Settings > Service Domain in your Cyclr console. For example, https://{ServiceDomain}/connector/callback
  1. Make a note of the Client ID and Client Secret.

For more information, see Google’s guide on how to create client credentials.

Service Account – remote setup

To authenticate the Connector using the “Service Account” Authentication Type, you need to do the following:

  1. Enable the “Google Sheets API” for a project within your Google workspace.
  2. Create a service account.
  3. Enable domain-wide delegation for the service account.
Create a Service Account

A service account needs to be created to allow admin-level access to Google Sheets within your workspace. Google’s documentation on how to do this can be found here.

When creating the service account, set up the fields below as follows:

  • Grant this service account access to project: Set the service account role to Owner.
  • Grant users access to this service account: Set the Service account admins role field to any users that will be administering the service account.

Make a note of the OAuth 2.0 client ID and Email for your service account. You will need these to enable domain-wide delegation and to authorize your account with Cyclr. You can find this on the service accounts page.

When adding the service account key, set the Key type to JSON, then open the downloaded .json key file and make a note of the private_key field. You need this to authorize your account with Cyclr.

Enabling domain-wide delegation for your Service Account

Domain-wide delegation needs to be enabled for your service account to allow it to access user data on behalf of users in your workspace. You need to be a “super administrator” of the workspace to configure this. Google’s documentation on how to do this can be found here.

When enabling domain-wide delegation, set up the fields below as follows:

  • Client ID: Set to the OAuth 2.0 client ID from the previous section.
  • OAuth scopes (comma-delimited):
    Add the following scopes:
    • https://www.googleapis.com/auth/spreadsheets – for Sheets access.
    • https://www.googleapis.com/auth/drive.metadata.readonly – for Drive metadata read access.

Partner Setup in Cyclr Console

Having performed the appropriate setup described above, go to your Cyclr Partner Console:

  1. Go to Connectors > Application Connector Library.
  2. Use the search box to locate the Google Sheets Connector entry.
  3. Select the Pencil button.
  4. In the Authentication dropdown, select either OAuth2 or Service Account, then follow the appropriate section below:

“OAuth2” Setup

  1. Select the Settings tab.
  2. Enter the below values:
ValueDescription
Client IDThe default client ID to use.
Client SecretThe default client secret to use.
ScopesThe scopes to use.
Cyclr defaults to the following if you don’t provide a value:
https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/drive.metadata.readonly
  1. Select Save Changes.

If you leave these values blank, they must be provided each time the Connector is installed.

“Service Account” Setup

  1. Select the Settings tab.
  2. Enter the below values:
ValueDescription
Client IDLeave blank.
Client SecretLeave blank.
ScopesThe scopes to use.
Cyclr defaults to the following if you don’t provide a value:
https://www.googleapis.com/auth/spreadsheets https://www.googleapis.com/auth/drive.metadata.readonly
  1. Select Save Changes.

If you leave these values blank, they must be provided each time the Connector is installed.

Cyclr Connector installation

Depending on the Authentication Type you’ve chosen, the installation of a Google Sheets Connector is slightly different, as explained below:

“OAuth2” Installation

When authenticating the Connector, the user must be signed in using the relevant Google user and then provide consent to your Google project to access their data.

Note: With the “OAuth2” Authentication Type, the Service Account Email, Service Account Administrator Email, and Service Account Private Key fields should be ignored.

“Service Account” Installation

The following values must be provided for the Google workspace to connect with:

ValueDescription
Service Account EmailThe email address of the service account.
Service Account Administrator EmailThe email address of the administrator of the service account.
Service Account Private KeyThe private key of the service account.