Skip to contents

Creates up to 10 records per API call. If more than 10 records are provided, they are automatically batched.

Usage

at_create_records(
  base_id,
  table_id,
  records,
  typecast = FALSE,
  token = NULL,
  progress = NULL
)

Arguments

base_id

Base ID (e.g., "appXXXXXX").

table_id

Table name or ID.

records

A list of record objects. Each should be a list with a fields element (a named list of field values).

typecast

If TRUE, Airtable will attempt to cast values to the correct type.

token

Personal access token (resolved via air_token() if NULL).

progress

Logical or NULL. If TRUE, shows a cli progress bar for batch operations. If NULL (default), uses option airtable2.progress.bar or env var AIRTABLE2_PROGRESS_BAR (both default to FALSE).

Value

A list of created record objects (with assigned IDs).

Examples

if (FALSE) { # \dontrun{
records <- list(
  list(fields = list(Name = "Alice", Age = 30)),
  list(fields = list(Name = "Bob",   Age = 25))
)
created <- at_create_records("appXXXXXXXXXXXXXX", "Contacts", records)
vapply(created, function(r) r$id, character(1))
} # }