The preferred metadata workflow: pull field names and descriptions from
a source (default: the "_metadata" table inside the same base), compare
against the live schema, and PATCH any changed fields.
Arguments
- base_id
Base ID (e.g.,
"appXXXXXX"). IfNULL, uses the session default set byair_set_base()or theAIRTABLE_BASE_IDenvironment variable.- source
Where to pull the edited metadata from. Defaults to
"_metadata", meaning the_metadatatable insidebase_id. Can also be adata.frame, a path to a.csvfile, or a path to a.jsonfile (see Source precedence above).- ...
Ignored; forces
.tokento be named.- .token
Personal access token (resolved via
air_token()ifNULL).
Typical workflow
Seed – run
air_meta_init()once to create / populate the"_metadata"table from the live schema.Edit – open the
"_metadata"table in Airtable and changefield_name/descriptioncells to your liking.Sync – call
air_meta_sync()(no arguments needed) to PATCH the schema with your edits.
Source precedence
source is resolved in this order:
A
data.frame→ used directly.A length-1 character path to an existing
.csvfile → read withutils::read.csv().A length-1 character path to an existing
.jsonfile → read withjsonlite::fromJSON().A length-1 character string that matches neither 2 nor 3 → treated as a table name inside the base and read with
air_read().
The source tibble must contain at least field_id, table_id,
field_name, and description columns (the shape produced by
air_meta() and air_meta_init()). An extra meta_key column (produced
by older seed runs) is silently ignored.
Examples
if (FALSE) { # \dontrun{
# 1. Seed the _metadata table from the live schema (run once)
air_meta_init("appXXXXXX")
# 2. Edit field_name / description cells directly in Airtable ...
# 3. Pull edits back and patch the schema
air_meta_sync("appXXXXXX")
# 4. Alternatively, sync from a local CSV
air_meta_sync("appXXXXXX", source = "my_meta.csv")
} # }