Skip to content

Latest commit

 

History

History
46 lines (26 loc) · 2.82 KB

airtable.md

File metadata and controls

46 lines (26 loc) · 2.82 KB

Create an Airtable remote data block

This tutorial will walk you through connecting an Airtable data source and how to use the automatically created block in the WordPress editor.

Base and personal access token

First, identify an Airtable base and table that you want to use as a data source. This example uses a base created from the default “Event planning” template, accessible from the Airtable home screen after logging in. We will target the “Schedule” table from that base.

airtable-template

Next, create a personal access token that has the data.records:read and schema.bases:read scopes and has access to the base or bases you wish to use.

create-pat

You should not commit this token directly to your code or share it publicly. The Remote Data Blocks plugin stores the token in the WordPress database.

Create the data source

  1. Go to Settings > Remote Data Blocks in your WordPress admin.
  2. Click on the "Connect new" button.
  3. Choose "Airtable" from the dropdown menu as the data source type.
  4. Name this data source. This name is only used for display purposes.
  5. Enter the access token you created in Airtable.

If the personal access token is correct, you will be able to proceed to the other steps. If you receive an error, check the token and try again.

  1. Select your desired base and tables.
  2. Save the data source and return the data source list.

Insert the block

Create or edit a page or post, then using the Block Inserter, search for the block using the name you provided in step four.

select-from-list.mov

Patterns and styling

You can use patterns to create a consistent, reusable layout for your remote data. You can read more about patterns and other Core Concepts.

Remote data blocks can be styled using the block editor's style settings, theme.json, or custom stylesheets. See the example child theme for more details.

Code reference

You can also configure Airtable integrations with code. These integrations appear in the WordPress admin but can not be modified. You may wish to do this to have more control over the data source or because you have more advanced data processing needs.

This working example will replicate what we've done in this tutorial.