> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# List records

> List Airtable records with native views, formulas, field selection, and sorting.

`listRecords` reads matching records and follows Airtable offset pagination
automatically. Use it for table scans and provider-native filtered queries.

## Example

```ts automations/list-open-leads.automation.ts theme={null}
import { automation, onHttpRequest } from "automate.ax"
import { listRecords } from "automate.ax/airtable"

export default automation("List open Airtable leads", () => {
  onHttpRequest({ scope: "automation" })

  listRecords({
    base: "CRM",
    table: "Leads",
    fields: ["Name", "Value", "Status"],
    filterByFormula: "{Status} = 'Open'",
    sort: [{ field: "Value", direction: "desc" }],
    maxRecords: 100,
  })
})
```

## Inputs

| Input                   | Type                                                | Required | Default            | Description                                                    |
| ----------------------- | --------------------------------------------------- | -------- | ------------------ | -------------------------------------------------------------- |
| `base`                  | `string`                                            | Yes      | —                  | Exact base name or stable ID.                                  |
| `table`                 | `string`                                            | Yes      | —                  | Table name or stable ID.                                       |
| `fields`                | `string[]`                                          | No       | All visible fields | Field names or IDs to return.                                  |
| `filterByFormula`       | `string`                                            | No       | None               | Airtable formula that each record must satisfy.                |
| `view`                  | `string`                                            | No       | None               | View name or ID used to constrain and initially order records. |
| `sort`                  | `{ field: string; direction?: "asc" \| "desc" }[]`  | No       | None               | Ordered sort rules; each direction defaults to `"asc"`.        |
| `pageSize`              | `number`                                            | No       | `100`              | Records requested per provider page, from 1 through 100.       |
| `maxRecords`            | `number`                                            | No       | No limit           | Maximum records returned across all pages.                     |
| `returnFieldsByFieldId` | `boolean`                                           | No       | `false`            | Key fields by stable ID instead of name.                       |
| `account`               | `string \| IntegrationAccountReference<"airtable">` | No       | Project default    | Connected Airtable account.                                    |

## Output

Returns `{ records: AirtableRecord[]; count: number }`. Each record contains
`id`, `createdTime`, and `fields`.

When both `view` and `filterByFormula` are present, Airtable applies both. A
sort supplied here overrides the view's ordering. Invalid formulas and unknown
field names fail with Airtable's provider error.
