////
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at
  http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
////
:documentationPath: /pipeline/transforms/
:language: en_US
:description: The Google Sheets Input transform reads data from a Google Sheets worksheets.

= image:transforms/icons/google-sheets-input.svg[Google Sheets Input transform Icon, role="image-doc-icon"] Google Sheets Input

[%noheader,cols="3a,1a", role="table-no-borders" ]
|===
|
== Description

The Google Sheets Input transform reads data from a Google Sheets worksheets.

This transform requires a Google service account (JSON file) and a Google Cloud project with the Google Drive and Google Sheets API enabled.

|
== Supported Engines
[%noheader,cols="2,1a",frame=none, role="table-supported-engines"]
!===
!Hop Engine! image:check_mark.svg[Supported, 24]
!Spark! image:question_mark.svg[Maybe Supported, 24]
!Flink! image:question_mark.svg[Maybe Supported, 24]
!Dataflow! image:question_mark.svg[Maybe Supported, 24]
!===
|===

== Options

=== Service account tab


[%header, width="90%", cols="1,4"]
|===
|option|description
|JSON credential key file|Lets you specify or browse for spreadsheets existing in the service account drive or for the ones that are shared with the service account email.
|Application Name|Your application name for the service account in the Google Developer Console.
|Timeout|lets you specify an https timeout (in minutes, defaults to 5).
|Impersonation|lets you impersonate your service account. Check the https://cloud.google.com/iam/docs/impersonating-service-accounts[Google docs] for more information.
|===

Click the `Test Connection` button to verify your specified JSON credential key file for your service account can use the Google Drive and Spreadsheets APIs and has access to your Google Spreadsheets. On success, you will see a `Google Drive API: Success!` message.

=== Spreadsheet tab

[%header, width="90%", cols="1,4"]
|===
|option|description
|Spreadsheet Key|specify the key for the Google Spreadsheet you want to read from. Click the "Browse" button to get a list of available spreadsheets.
|Worksheet Id|specify the worksheet id (title) for the sheet in your Google Spreadsheet you want to read from. Click the "Browse" button to get the list of available worksheets in the selected Google Spreadsheet.
|===

===  Fields tab

Lets you select from the fields of the sheet.

Fields name are always defined in the first line of the google spreadsheet.

**Get Fields** lets you get fields and guess their types, format, precision, decimal and group delimiter as well as trim type.

