# Google

The Google Data Operation is used to write and fetch data from Google Sheets.&#x20;

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-3d088c656dea6a3f870fbd4f62c8f8f8126578e5%2Fthe-google-data-operation-v184-0.png?alt=media)

## Use Cases

* Send data from Airkit to a Google Spreadsheet
* Fetch data from a Google Spreadsheet to display to an app user your Airkit app

## Data Operation Properties

### Datasource

The Google Instance to perform the Data Operation on. The dropdown options are populated by the list of integrated Instances in your Airkit App under **Settings > Integrations**.

### Operation

The Google operation to perform. There are two operations available:

\###Append row

Appends a row to a specified Google Sheet. For example, intakes data from a form on Airkit to be saved into a Google Sheet.

**Drive (optional)**

Selects the desired Google Drive to retrieve Sheets from.  If no value is selected, all Google Drives connected to the App will be available.

By checking **Use a custom expression**, the cell becomes an expression editor and expects the Drive ID as a string.

**Spreadsheet**

Selects the Spreadsheet to work with. This dropdown is populated with all the Google Sheets from the Google Drive accounts that are connected to the app.

By checking **Use a custom expression**, the cell becomes an expression editor and expects the spreadsheet ID as a string.

**Worksheet**

Selects the specified Worksheet to perform the **Operation** on. This dropdown is populated with the list of all the Worksheets within the specified **Spreadsheet**.

By checking **Use a custom expression**, the cell becomes an expression editor and expects the worksheet ID as a string.

**Record Values**

Selects the desired column for the data to be appended to and the corresponding value. This field expects an object with the keys of the index of the row column. It is only possible to write to one row at a time and this operation will write to the first empty row in the sheet.

**Example:**

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-49b401745f13a42a4b9cf51b1c2b47104d370c7d%2Fthe-google-data-operation-v184-1.png?alt=media)

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-561da67e6cd63382c7c71b1e103cfa966e48b600%2Fthe-google-data-operation-v184-2.png?alt=media)

By checking the Expression icon on the right, the cell becomes an expression editor.

**Value Input Option (optional)**

Determines how the input data is interpreted.

The available operations are:

* **RAW:** If selected, the data or value passed will not be parsed or evaluated. For instance, if the value `SUM(1,2)` is entered, the String of  `SUM(1,2)` will be the input.
* **USER\_ENTERED:** If selected, Google Sheets will attempt to evaluate the String where if the value of `SUM(1,2)` is entered, the value of 3 will be the input.

#### Fetch Cell Values

Fetches data from Google Sheets that can be stored within a variable for use in subsequent Data Operation steps. For example, retrieve data from a Google Sheet to be displayed to an app user.

**Spreadsheet**

Selects the Spreadsheet to perform the **Operation** on. This dropdown is populated with the list of all the Google Spreadsheets associated with your username.

By checking **Use a custom expression**, the cell becomes an expression editor and expects the spreadsheet ID as a string.

**Worksheet**

Selects the specified Worksheet to perform the **Operation** on. This dropdown is populated with the list of all the Worksheets within the specified **Spreadsheet**.

By checking **Use a custom expression**, the cell becomes an expression editor and expects the worksheet ID as a string.

**Cell Range**

Selects the specified Worksheet to perform the **Operation** on. This dropdown is populated with the list of all the Worksheets within the specified **Spreadsheet**. Expects an a1 style input such as "A1:B1"

Example, from the spreadsheet of these values:

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-561da67e6cd63382c7c71b1e103cfa966e48b600%2Fthe-google-data-operation-v184-2.png?alt=media)

The following **Cell Range:**

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-8d3de3109afcf1ce5ecf4f1266fdf32c12dba235%2Fthe-google-data-operation-v184-4.png?alt=media)

Returns the following:

![organizing info](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-2961b46fb168c29db52f6d61a0e1ebda796a2b22%2Fthe-google-data-operation-v184-5.png?alt=media)

**Value Render Options**

Determines how values should be rendered in the output.

**Formatted Value**\
Values will be calculated & formatted in the reply according to the cell's formatting. Formatting is based on the spreadsheet's locale, not the requesting user's locale. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return `"$1.23"`.

**Unformatted Value** Values will be calculated, but not formatted in the reply. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then `A2` would return the number `1.23`.

**Formula:**\
Values will not be calculated. The reply will include the formulas. For example, if `A1` is `1.23` and `A2` is `=A1` and formatted as currency, then A2 would return `"=A1"`.

## Run Results

In both cases, Airkit creates a variable called "Google" that can then be passed into subsequent operations.
