# Airtable

> Work with Airtable bases, tables, and records.

App · Databases · 7 actions · 1 trigger. Web page: https://docs.lodol.com/docs/integrations/airtable

## Triggers

Start a workflow when something happens in Airtable. See [how triggers work](https://docs.lodol.com/docs/concepts/triggers.md).

### Airtable New Record

Triggers when a new record is added to an Airtable table

**Filters**: Narrow which events start a run.

- `base_id` (required)
- `table_name` (required)

**Event fields**: What a run starts with. Later steps read each field with an @ reference.

- `id` (text)
- `fields` (object)
- `created_time` (text)

## Actions

### Create record

Create a new record in an Airtable table.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.
- Table (`table_name`, text, required): The table to use.
- Fields (`fields`, object, required): The value to set for each field in the table.

**Outputs**

- `createdTime` (text): Creation timestamp
- `fields` (object): Record fields
- `id` (text): Created record ID (use this as record_id in update_record or delete_record)

**Example output**

```json
{
  "createdTime": "2024-01-15T10:30:00Z",
  "fields": {
    "Email": "john@example.com",
    "Name": "John Smith",
    "Status": "Active"
  },
  "id": "rec9K3L2mN4P5Q6R"
}
```

### Delete record

Delete a record from an Airtable table.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.
- Table (`table_name`, text, required): The table to use.
- Record (`record_id`, text, required): The record to use.

**Outputs**

- `deleted` (true/false): Whether the item was deleted

**Example output**

```json
{
  "deleted": true
}
```

### Get record

Retrieve a single record by ID.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.
- Table (`table_name`, text, required): The table to use.
- Record (`record_id`, text, required): The record to use.

**Outputs**

- `createdTime` (text): Creation timestamp
- `fields` (object): Record fields
- `id` (text): Record ID

**Example output**

```json
{
  "createdTime": "2024-01-15T10:30:00Z",
  "fields": {
    "Email": "john@example.com",
    "Name": "John Smith",
    "Status": "Active"
  },
  "id": "rec9K3L2mN4P5Q6R"
}
```

### List bases

Retrieve all accessible Airtable bases.

**Inputs**: None.

**Outputs**

- `bases` (list): List of bases

**Example output**

```json
{
  "bases": [
    {
      "id": "appaBc123DeFg456",
      "name": "Marketing Campaigns",
      "permissionLevel": "create"
    }
  ]
}
```

### List records

Retrieve records from an Airtable table.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.
- Table (`table_name`, text, required): The table to use.
- Max records (`max_records`, number): Maximum number of records to return.
- Filter formula (`filter_formula`, text): An Airtable filter formula that limits which records are returned, for example {Status} = 'Active'.

**Outputs**

- `records` (list): List of records

**Example output**

```json
{
  "records": [
    {
      "createdTime": "2024-01-15T10:30:00Z",
      "fields": {
        "Email": "john@example.com",
        "Name": "John Smith",
        "Status": "Active"
      },
      "id": "rec9K3L2mN4P5Q6R"
    }
  ]
}
```

### List tables in a base

Fetch all tables for a specific Airtable base.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.

**Outputs**

- `tables` (list): List of tables

**Example output**

```json
{
  "tables": [
    {
      "id": "tblXyz789AbC123",
      "name": "Contacts",
      "primaryFieldId": "fldPqR456StU789"
    }
  ]
}
```

### Update record

Update fields on an existing Airtable record.

**Inputs**

- Base (`base_id`, text, required): The Airtable base to use.
- Table (`table_name`, text, required): The table to use.
- Record (`record_id`, text, required): The record to use.
- Fields (`fields`, object, required): The value to set for each field in the table.

**Outputs**

- `createdTime` (text): Creation timestamp
- `fields` (object): Updated record fields
- `id` (text): Record ID

**Example output**

```json
{
  "createdTime": "2024-01-15T10:30:00Z",
  "fields": {
    "Email": "john@example.com",
    "Name": "John Smith",
    "Status": "Inactive"
  },
  "id": "rec9K3L2mN4P5Q6R"
}
```
