google sheets source Google Sheets Source

Provided by: "Apache Software Foundation"

Receive data from Google Sheets.

Configuration Options

The following table summarizes the configuration options available for the google-sheets-source Kamelet:

Property Name Description Type Default Example

accessToken *

Access Token

OAuth 2 access token for google sheets application. This typically expires after an hour so refreshToken is recommended for long term usage.

string

applicationName *

Application name

Google Sheets application name

string

clientId *

Client Id

Client ID of the sheets application

string

clientSecret *

Client Secret

Client Secret of the sheets application

string

index *

Index

An index for the google sheets endpoint

string

refreshToken *

Refresh Token

OAuth 2 refresh token for google sheets application. Using this, the Google Calendar component can obtain a new accessToken whenever the current one expires - a necessity if the application is long-lived.

string

spreadsheetId *

Spreadsheet ID

The Spreadsheet ID to be used as events source

string

delay

Delay

Milliseconds before the next poll

integer

500

range

Consume from now

the range of rows and columns in a sheet to get data from.

boolean

"A1:B3"

splitResults

Split Results

True if value range result should be split into rows or columns to process each of them individually.

boolean

true

Fields marked with (*) are mandatory.

Usage

This section summarizes how the google-sheets-source can be used in various contexts.

Knative Source

The google-sheets-source Kamelet can be used as Knative source by binding it to a Knative object.

google-sheets-source-binding.yaml
apiVersion: camel.apache.org/v1alpha1
kind: KameletBinding
metadata:
  name: google-sheets-source-binding
spec:
  source:
    ref:
      kind: Kamelet
      apiVersion: camel.apache.org/v1alpha1
      name: google-sheets-source
    properties:
      accessToken: "The Access Token"
      applicationName: "The Application name"
      clientId: "The Client Id"
      clientSecret: "The Client Secret"
      index: "The Index"
      refreshToken: "The Refresh Token"
      spreadsheetId: "The Spreadsheet ID"
  sink:
    ref:
      kind: InMemoryChannel
      apiVersion: messaging.knative.dev/v1
      name: mychannel

Make sure you have Camel K installed into the Kubernetes cluster you’re connected to.

Save the google-sheets-source-binding.yaml file into your hard drive, then configure it according to your needs.

You can run the source using the following command:

kubectl apply -f google-sheets-source-binding.yaml