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 (Create, Read, Update, Delete) operations on records that you have stored in Airtable, Google Sheets or Local Tables.
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 or a Data Viewer Grid to your project
Click on the ⊕ icon in the Data Sources section of your component tree:
In the modal that appears, you can choose a previously connected Data Source, or add a new Data Source.
When adding a new Data Source, you can choose between Create your own table, Airtable or Google Sheets as the source of your data.
Open a data source.
Click Add Filter View.
Add one or more filter rules.
Click Create Filter View.
Select the Filter View in a data viewer's properties panel.
Open a data source.
Click on a Filter View.
Click Sort icon.
Select column.
Select Ascending or Descending.
Start by naming your data source.
You can now see this Data Source from your Data Sources section. Click on the Data Source name to edit it.
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.
Connect Your App to Airtable by OAuth
Click Connect to Airtable.
In Thunkable, click the data icon in the left side panel to access your data source library.
Click the plus sign at the top of the panel.
You can select from previously added data sources or add a new data source. Click Create New.
Select Airtable.
Click the OAuth tab.
An Airtable authorization screen opens.
Click + Add a base.
Select the bases you want to authorize access to.
Select all the bases you want your Thunkable projects to have access to. This includes any bases you've previously connected by API key, as well as any new bases you want to connect to Thunkable.
Click Grant access.
If you are connecting by OAuth for the sole purpose of migrating your connection from API Key and are not creating a new data source, you are done. The following steps only apply when creating a new data source.
Select the correct base from the dropdown menu.
Indicate if you'd like to use a custom view. Learn more here: Use a Custom View.
Click Create.
Refresh your page to ensure the data is reflected in web preview or via the Thunkable Live app.
This block is only necessary for Creators who use web API blocks to communicate with Airtable.
If your app uses web API blocks to communicate with Airtable, you must also incorporate the "authorization header for" block into your app. This block retrieves a valid token that can be used as the authorization header in web API blocks.
To use the "authorization header for" block:
Ensure your project is connected to an Airtable data source by OAuth.
Navigate to your project's blocks tab.
Under the App Features heading, click Data Sources.
Drag and drop the "authorization header for" block into your workspace.
Use the block's dropdown menu to ensure the correct data source is selected.
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 shareable for Thunkable to access its data.
To connect a Google Sheet, sign in and grant permission for your Thunkable project to access your Google Drive.
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.
Once you have allowed this, you will see a list of spreadsheets in your Google Drive. If you don't seen 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.
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.
Looking to reset your Google Sheets connection? Click here for instructions
The create row in
block allows you to append new rows to the end of your data tables.
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.
There is a second create row in block which allows you to add a row in your data source using an object. The field is the column name and the cell info is the value you would like to set.
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 and the view in the block itself and pass the unique row id as an input.
The valid id types are index and unique id. The index refers to the row by its integer position (1 for the first row, 2 for the second row, etc.) and must be greater than zero.
Get row object
will return the row object of the specified row ID. The row object can be used with Objects blocks.
The get row object from
block returns the row object of the first row that meets the specified condition. You can specify the column name and condition in the block itself and pass the value as an input. The row object can be used with Objects Blocks.
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.
The number of rows in
block returns an integer corresponding to how many rows are in a given table.
The columns in
block returns the column names of a data source.
The update value in
block allows you to modify or update an existing cell in your data source. The column name and view are specified in the block itself. The row id and new value are passed as inputs.
There is a second update row in
block which allows you to update a row in your data source using an object. The field is the column name and the cell info is the value you would like to set.
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.
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.
The update filter for
block allows you to edit the value for each condition within a specific view of your data source.