Skip to content

Commit

Permalink
Document connecting to Google Sheets as a source (#3864)
Browse files Browse the repository at this point in the history
Adding short primer / section on how to connect to and read from Google Sheets from Rill directly.
  • Loading branch information
AndrewRTsao authored Jan 17, 2024
1 parent e6fdae2 commit aad91d9
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion docs/docs/develop/import-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ To import a file using the UI, click "+" by Sources in the left hand navigation
### Using code
When you add a source using the UI, a code definition will automatically be created as a `.yaml` file in your Rill project in the `sources` directory. However, you can also create sources more directly by creating the artifact.

In your Rill project directory, create a `source_name.yaml` file in the `sources` directory with the following contents:
In your Rill project directory, create a `source_name.yaml` file in the `sources` directory with the following content:

```yaml
type: local_file
Expand All @@ -41,6 +41,21 @@ For more details about available configurations and properties, check our [Sourc

:::

### Google Sheets

Rill is very flexible and can read from any http(s) URL endpoint that produces a valid data file in a supported format. For example, to bring in data from Google Sheets as a CSV file directly into Rill as a source ([leveraging the direct download link syntax](https://www.highviewapps.com/blog/how-to-create-a-csv-or-excel-direct-download-link-in-google-sheets/)), you can create a `source_name.yaml` file in the `sources` directory of your Rill project directory with the following content:

```yaml
type: "duckdb"
path: "select * from read_csv_auto('https://docs.google.com/spreadsheets/d/<SPREADSHEET_ID>/export?format=csv&gid=<SHEET_ID>', normalize_names=True)"
```

:::note Updating the URL

Make sure to replace `SPREADSHEET_ID` and `SHEET_ID` with the ID of your spreadsheet and tab respectively (which you can obtain from looking at the URL when Google Sheets is open).

:::

## Adding a remote source

### Using the UI
Expand Down

0 comments on commit aad91d9

Please sign in to comment.