> For the complete documentation index, see [llms.txt](https://docs.thunkable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thunkable.com/~/changes/wHhkjLVeheBnfbpghRnw/data-sources.md).

# Data Sources

The Data Sources blocks allow you work with the information that you have stored in your connected Airtable Bases, Google Sheets or Local Tables.

The Data Sources blocks allow you to perform a variety of CRUD (**C**reate, **R**ead, **U**pdate, **D**elete) operations on records that you have stored in Airtable, Google Sheets or Local Tables.

## Add a Data Source to your App

To access the Data Sources blocks you need to add a Data Source to your app. There are two ways to do this:

* Add a [Data Viewer List](/~/changes/wHhkjLVeheBnfbpghRnw/data-viewer-list.md) or a [Data Viewer Grid](/~/changes/wHhkjLVeheBnfbpghRnw/data-viewer-grid.md) to your project
* Click on the ⊕ icon in the Data Sources section of your component tree:

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MWizfLGLUSAeEaDV42G%2F-MWj-arQraOyI8mBvwrA%2FScreen%20Shot%202021-03-26%20at%202.46.24%20PM.png?alt=media\&token=17d65347-a66e-4b93-b1a3-4b292842bdb4)

In the modal that appears, you can choose a previously connected Data Source, or add a new Data Source.&#x20;

### Adding a New Data Source

When adding a new Data Source, you can choose a source of your data:

* [Create your own table](#create-your-own-table)
* [Airtable](#airtable)
* [Google Sheets](#google-sheets)
* [Webflow](#webflow)

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FN1yCnfQzFEREAB3nf3lV%2FScreen%20Shot%202021-11-05%20at%209.30.56%20AM.png?alt=media\&token=6102542e-309f-4592-9725-f8bfc1889bb0)

### Create your Own Table

{% embed url="<https://youtu.be/2x52CJQsc9M>" %}

Start by naming your data source.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5TUcYV8jP9gDC_CxOv%2F-M5W0WKYRIT9CSxsbour%2Fname_local_data2.png?alt=media\&token=9ff168e8-633f-4c36-8638-71d9a4f6375b)

You can now see this Data Source from your Data Sources section.\
Click on the pen to rename the Data Source. \
Click on the Data Source name to edit the data.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FMsHSd4hsSErJR9dILDRq%2FScreen%20Shot%202022-02-04%20at%2012.14.36%20PM.png?alt=media\&token=765492b5-66e2-48f0-8e26-d529543efa2b)

The data editor allows you to edit, add, and delete columns of information. To change any of the individual values simply click on the cell and type whatever you like.&#x20;

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5TUcYV8jP9gDC_CxOv%2F-M5W2HffumEmAl4knl03%2Fedit_table2.png?alt=media\&token=d11384a7-8751-4781-a859-b6b5ceead828)

### Airtable&#x20;

{% embed url="<https://youtu.be/izoH3t0y2hQ>" %}

In Airtable, a base in considered to be the data source. Adding an [Airtable DB](broken://pages/-LZ7M7dKMr1EHAaEGE7f) is really simple.&#x20;

To start, copy your API key from your Airtable [account page](https://airtable.com/account). An Airtable API key is a 14 character code that begins with the three letters "key". Paste this key into Thunkable and click the `Refresh` button to see a list of your Airtable bases.&#x20;

Choose the base you want to use as your data source and click `Create`.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5N089QjP7Y0QSwxJJh%2F-M5N3mC9QL4Sw15eznRB%2Fairtable_setup.png?alt=media\&token=6968a1dd-830e-4099-a14f-57e60467ee6c)

### Google Sheets

{% embed url="<https://youtu.be/0YsorQtDsvc>" %}

In Google Sheets, the entire document is considered to be the data source.

In order to use a Google Sheet as a data source, the first row in your Sheet must be a **header** row.

Your Google Sheet must be [sharable](https://support.google.com/docs/answer/2494822?hl=en\&co=GENIE.Platform%3DDesktop) for Thunkable to access its data.&#x20;

To connect a Google Sheet, sign in and grant permission for your Thunkable project to access your Google Drive.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5WKUZDPQw2_zsl_vWB%2F-M5WVsV-XrpMPfzSGb1P%2Fsign%20in.png?alt=media\&token=3d4ff936-a74e-43bd-bb49-f9f14abbeb27)

{% hint style="warning" %}
Some users have reported issues connecting to Google Sheets if they are using G Suite for Education accounts. You may need to contact your G Suite administrator to review your security settings.&#x20;
{% endhint %}

Once you have allowed this, you will see a list of spreadsheets in your Google Drive. If you don't see the sheet you are looking for you can switch to list view, sort alphabetically or search for the one you need. Click `Select` to return to your Thunkable project.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5WKUZDPQw2_zsl_vWB%2F-M5WW49s_8UHw3NCjWZs%2Fselect%20a%20file.png?alt=media\&token=9d22bd0c-17d5-4394-b8e0-e55f6be6e724)

At this time, connecting to **.xlsx** files that are hosted on Google Sheets is not supported. You can convert your .xlsx file to a Google Sheet before connecting it to your Thunkable app project. Simply open your .xlsx file on Google Sheets, then click **File > Save as Google Sheets**.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MHpB8HtC8HSyz0Kqb8S%2F-MHpBn0p_e2Fs7u99yPu%2FScreen%20Shot%202020-09-21%20at%2011.37.46%20AM.png?alt=media\&token=806737ab-0b46-46f7-bbcf-aef125533783)

{% hint style="info" %}
Looking to reset your Google Sheets connection? [Click here](/~/changes/wHhkjLVeheBnfbpghRnw/troubleshooting.md#how-can-i-reset-my-google-sheets-connection-in-thunkable) for instructions
{% endhint %}

### Webflow

{% embed url="<https://www.youtube.com/watch?v=4WLOPIP_WuY/?1>" %}

When using Weblow as the data source for your Thunkable app, you’ll connect to a Webflow CMS or Content Management System collection.&#x20;

To connect your Webflow CMS to your Thunkable project, you have two options:

* API Key
* OAuth

#### Connecting by API Key

Within the Webflow platform:

1. Navigate to your site settings.
2. Click the Integrations tab
3. Under the **API access** header, click Generate API token.&#x20;
4. Copy the Webflow API token.

Within the Thunkable platform:

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FgjYhp31hv2YacvBRdl6s%2Fdata%20sources%20-%20webflow%20-%20API%20Key.png?alt=media\&token=05024ecb-9818-4551-b0db-fc4b052ad5a1)

1. Paste the copied Webflow API token into the corresponding field.&#x20;
2. Click **Refresh** to see your Webflow sites.&#x20;
3. Select the site you want to use as your data source.
4. Click Create.&#x20;

{% hint style="info" %}
To protect the quality of its service, the Webflow CMS API default rate limit is 60 requests/minute.  Exceeding this limit will result in an error on the Thunkable platform, so please keep this in mind as you build your app.
{% endhint %}

#### Connecting by OAuth

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2FzLHi3Q7k4aLtTCSRv4e1%2Fdata%20sources%20-%20webflow%20-%20OAuth.png?alt=media\&token=ccafc13d-3d62-4221-ab39-5aac11e29e33)

1. Click **Connect to Webflow**.
2. A Webflow authorization screen opens.
3. Select the sites or Workspaces you want to authorize access to.
4. Click **Authorize app**.<br>

   <figure><img src="https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LAn5scXl2uqUJUOqkJo-84897653%2Fuploads%2F38dFiUo6lQ94pf3rSsla%2Fdata%20sources%20-%20webflow%20-%20authorize.png?alt=media&amp;token=0a7f8456-9b15-444a-a430-2f5c69d35c97" alt=""><figcaption></figcaption></figure>

## Data Source blocks

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aNVeT7AJk-jX64wT4%2Fdata_sources_drawer.png?alt=media\&token=e358fb27-570f-4ba5-a816-bac2c2704a82)

### Create&#x20;

The `create row in`block allows you to append new rows to the end of your data tables.&#x20;

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aPpI5KxOgLLhjwyBr%2Fcreate_row.png?alt=media\&token=9f08bf0a-126a-421e-8826-ea5839c5fed5)

The inputs are dynamic so if you change the name of Column 1 or Column 2 in the designer these changes will be reflected in the block too.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5TUcYV8jP9gDC_CxOv%2F-M5W2HffumEmAl4knl03%2Fedit_table2.png?alt=media\&token=d11384a7-8751-4781-a859-b6b5ceead828)

### Read&#x20;

The `get value from` blocks allows you get read one value from a specific cell in your data table. You can specify the column name in the block itself and pass the unique row id as an input.&#x20;

Note that each row has its own unique 24 character ID. You must use this ID to refer to rows of your Airtable and Local data sources in the blocks below.

If your data source is a **Google Sheet**, you can refer to the row by its integer position (1 for the first row, 2 for the second row, etc.)

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aQR1w75a-0r-buIDD%2Fget_value.png?alt=media\&token=5db182dc-1aad-4a0e-a74b-e45a700cdcdf)

`Get row object` will return the row object of the specified row ID. The row object can be used with [Objects blocks.](/~/changes/wHhkjLVeheBnfbpghRnw/objects.md)

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MHVZY9uFn5voyXFM3Ud%2F-MHV_1h1FUtdK1jzgXG6%2Fdarasourcesgetrowobject.png?alt=media\&token=74aa8bbb-fbcc-42a7-9d9d-e0b48851b92b)

The `list of values in` block allows you to read an entire column of data from a table and returns it as a list that you can then manipulate with the built-in [List blocks](/~/changes/wHhkjLVeheBnfbpghRnw/lists.md).

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aQW9ilyl6tPg1AXVV%2Flist_of_values.png?alt=media\&token=d8192d36-66ad-471e-85e3-5f820e0f97dd)

The `number of rows in` block returns an integer corresponding to how many rows are in a given table.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aQTa3eN2_BPVio35J%2Fnumber_of_rows.png?alt=media\&token=b3a74f22-6636-4e17-8280-4485b7e9f243)

### Update&#x20;

You can use the `update value in` block to modify or update an existing cell in your data table. The column name is specified in the block itself. Both the **row id** and new **value** are passed as inputs.&#x20;

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-M5aGJ1wOENtwwwS3swV%2F-M5aTUuc2_Xv2_48bAYG%2Fupdate_value.png?alt=media\&token=5696ec2f-2294-4eac-b194-7c777e5cbceb)

### Delete

#### Delete Row

You can use the `Delete Row` block to delete a row of data from your Data source. \
The `row id` is passed as an input.\
If there is an `error`, the error message is passed as an output.&#x20;

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MG8S3dFqpX5jUIA0MYV%2F-MG8T4RcGnM_Xf8c9r47%2Fdeleterow.png?alt=media\&token=36f901e0-e596-4148-a726-108320cc5464)

#### Delete All Rows

You can use the `delete all rows` block to delete all rows in your data source.\
If there is an `error`, the error message is passed as an output.

![](https://1223006790-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MHVZY9uFn5voyXFM3Ud%2F-MHVaRe5XI7cTbrCazZA%2Fdatasourcedeleteallrows.png?alt=media\&token=4b8b8d86-0188-4be1-abae-d4cf92669ded)
