Using the scripting extension to collect base metadata
  • 04 Oct 2022
  • 2 Minutes to read
  • Dark
    Light

Using the scripting extension to collect base metadata

  • Dark
    Light

This document outlines a solution for surfacing a base's metadata, or the schema, into a single table within that base using Airtable's Scripting extension and a script from the Marketplace.

Organizing the names of tables and fields into a tabular format can be incredibly helpful for users who want to understand the types of information captured in the base without needing to check each table individually.

4404327400983ScreenShot2021-07-15at92202AM.png

How can I create a single base with my metadata?

Metadata about your base can be programmatically accessed via Airtable’s scripting extension or Airtable's Metadata API, which is available to Enterprise users. In this guide, we'll customize a scripting extension in an example base to create an interface, aggregate base metadata, and write it to a standalone table for reference.

The script will also manage updating existing records (i.e. when a name or description changes), allowing users to run the script over time.

What you will need

An Airtable Pro or Enterprise plan

An Airtable base you'd like to extract metadata from. We're using this example base from Airtable Universe.

A link to the Extracting Base Metadata Marketplace Script

Access to the Scripting extension.
If you don't have access to the scripting extension as an enterprise user, please contact your enterprise administrator to adjust your permissions.

Step by Step Instructions

1. Create Metadata Table
In your base, create a table where you want to store your metadata. Add the following fields to your table:
Field NameField DescriptionField IDField Type
Field OptionsTable NameTable ID 

To ensure each record has a unique name, we recommend making the table's primary field a formula that concatenates the Table Name and Field Name into a single identifier. You could use something like this: {Table Name} &": " & {Field Name}

2. Add Marketplace Script

Click on the link to the Extracting Base Metadata Marketplace Script. Click the "Add Script" button in the top right corner, and choose the base where you added your Metadata table.

3. Configure Script Settings

After installing the marketplace script, you'll be asked to configure the settings that are unique to your base. In the settings menu, select:

  • The name of the table to write data to
  • The names of each field in the base to write data to

Once your settings are entered, you can press run, and within a few seconds, your new table will be populated with all of your base metadata information

What next?

This is a great start for extracting your metadata from Airtable. For users that would like to use Airtable metadata to build a custom integration, we recommend using our Metadata API, which is available to Enterprise users.

Would love to see how you and your team approach this integration and what specifically you’re trying to leverage Airtable for. Feel free to post at our Community Page your integration or reach out to our team directly at list-team-cse@airtable.com


Was this article helpful?