> For the complete documentation index, see [llms.txt](https://cgps.gitbook.io/data-flo/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cgps.gitbook.io/data-flo/reference-guide/import-from-google-sheet.md).

# import-from-google-sheet

## Description

<mark style="color:purple;">`import-from-google-sheet`</mark> *adaptor imports data from a Google Sheets spreadsheet.*

Private spreadsheets should be shared with <mark style="color:blue;"><data-flo@data-flo.iam.gserviceaccount.com></mark>, and given Editor permission.

## Inputs

**`url`**\
Type: `text`\
Required: Yes\
The URL of the Google Sheets spreadsheet. Private sheets should be shared with <mark style="color:blue;"><data-flo@data-flo.iam.gserviceaccount.com></mark>.

**`sheet name`**\
Type: `text`\
Required: No\
The title of the sheet (tab) from which data will be imported. If unspecified, the first sheet in the spreadsheet will be used.

**`range`**\
Type: `text`\
Required: No\
A valid range of cells (e.g. `A1:L512`) that contain data. If unspecified, the entire sheet will be included.

**`skip`**\
Type: `list`\
Required: No\
A list of row numbers to be ignored. If unspecified, then all rows in the range will be imported.

## Outputs

**`data`**\
Type: `datatable`\
A datatable containing the imported data.

## Examples

### Example 1: Default behaviour.

#### Inputs:

`url:` <https://docs.google.com/spreadsheets/d/12345/edit?usp=sharing>

`sheet name:` *null (empty)*

`range:` *null (empty)*

`skip:` *null (empty)*

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample B | 5.063345736 | -9.051186684 |
| Sample C | 5.063345736 | -9.051186684 |
| Sample D | 4.638091468 | -8.17536836  |

-> Imported the entire Google Sheet into Data-flo.

### Example 2: Import data from Google Sheet within a specified range.

#### Inputs:

`url:` <https://docs.google.com/spreadsheets/d/12345/edit?usp=sharing>

`sheet name:` *null (empty)*

`range:` A1:C4

`skip:` *null (empty)*

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample B | 5.063345736 | -9.051186684 |
| Sample C | 5.063345736 | -9.051186684 |

-> Imported the Google Sheet within the range `A1:C4`.

### Example 3: Import data from Google Sheet, skipping specific rows.

#### Inputs:

`file:` <https://docs.google.com/spreadsheets/d/12345/edit?usp=sharing>

`sheet name:` *null (empty)*

`range:` *null (empty)*

`skip:`

1. 2
2. 4

#### Outputs:

`data`:

| id       | latitude    | longitude    |
| -------- | ----------- | ------------ |
| Sample A | 4.642276772 | -8.17536836  |
| Sample C | 5.063345736 | -9.051186684 |

-> Imported the Google Sheet and skipped rows `2` and `4`.
