Google Sheets Uploader

The Google Sheets Uploader provides automated export of data to a Google Sheet

Prerequisites

Google Sheets uploader requires authentication either through a Google Service Account or Google OAuth.

Google Service Account

To authenticate via a Google Service Account add a Key with the Credential Type Google Service Account

Service accounts differ from user accounts in several key ways.

Client Email
Email address associated with the Service Account
Key Name
Value set here will be used in your Switchboard Script.
Key Type
Corresponds to the format of the Service Account Key. Typically the value is json
Service Account Key
Entire text of the key pair provided when a Service Account is generated

Google OAuth

To authenticate via Oauth you must add a Key with the Credential Type Google OAuth, enter a Key Name (used in the Switchboard Script below) and perform the Oauth flow by clicking the button labeled Connect.

Parameters

folder_name string
optional
The google drive folder name where the user wants to save the spreadsheet. If this folder name is not found, the connector will create the folder in the “home” drive.
primary_source_name string
required
The name of source of the data that was downloaded.
spreadsheet_name string
required
The name to use for the spreadsheet when it is created.
 
The following date patterns may be used to fill in the current date automatically.
  • 2022-06-01 (YYYY-MM-DD)
  • 2022-6-1 (single digit month and date)
  • 2022-Jun-1 (three letter month abbreviation)
  • 2022-June-1 (full month name)
 
The string UUID will be replaced with an eight digit alphanumeric string to ensure the uniqueness of the filename. It may be used in conjunction with date formatting such that fileYYYYMMDD_UUID.csv.gz will be formatted as file20220727_30FG06et.csv.gz
 
We strongly recommend that if you are going to use these two patterns together you use the date first so that you can sort the files by date.

Switchboard Script Syntax


export google_sheet_test_import to {
       type: "google_sheets";
       key: "my_google_oath_key";
       primary_source_name: "google_sheet_test_import";
       folder_name: "switchboard_uploads";
       spreadsheet_name: "Sample Upload"; // Required
       test_spreadsheet_name: "Sample Upload";
 };