|
| 1 | +import ChangeLog from '../changelog/connector-http-airtable.md'; |
| 2 | + |
| 3 | +# Airtable |
| 4 | + |
| 5 | +> Airtable source connector |
| 6 | +
|
| 7 | +## Description |
| 8 | + |
| 9 | +Used to read data from Airtable. |
| 10 | + |
| 11 | +## Key features |
| 12 | + |
| 13 | +- [x] [batch](../../introduction/concepts/connector-v2-features.md) |
| 14 | +- [ ] [stream](../../introduction/concepts/connector-v2-features.md) |
| 15 | +- [ ] [exactly-once](../../introduction/concepts/connector-v2-features.md) |
| 16 | +- [x] [column projection](../../introduction/concepts/connector-v2-features.md) |
| 17 | +- [ ] [parallelism](../../introduction/concepts/connector-v2-features.md) |
| 18 | +- [ ] [support user-defined split](../../introduction/concepts/connector-v2-features.md) |
| 19 | + |
| 20 | +## Options |
| 21 | + |
| 22 | +| name | type | required | default value | |
| 23 | +|-----------------------------|---------|----------|---------------| |
| 24 | +| token | String | Yes | - | |
| 25 | +| base_id | String | Yes | - | |
| 26 | +| table | String | Yes | - | |
| 27 | +| api_base_url | String | No | https://api.airtable.com | |
| 28 | +| view | String | No | - | |
| 29 | +| fields | List | No | - | |
| 30 | +| filter_by_formula | String | No | - | |
| 31 | +| max_records | int | No | - | |
| 32 | +| page_size | int | No | - | |
| 33 | +| sort | String | No | - | |
| 34 | +| cell_format | String | No | - | |
| 35 | +| return_fields_by_field_id | boolean | No | - | |
| 36 | +| record_metadata | List | No | - | |
| 37 | +| time_zone | String | No | - | |
| 38 | +| user_locale | String | No | - | |
| 39 | +| request_interval_ms | int | No | 220 | |
| 40 | +| rate_limit_backoff_ms | int | No | 30000 | |
| 41 | +| rate_limit_max_retries | int | No | 3 | |
| 42 | +| schema | Config | No | - | |
| 43 | +| schema.fields | Config | No | - | |
| 44 | +| format | String | No | text | |
| 45 | +| content_field | String | No | - | |
| 46 | +| json_field | Config | No | - | |
| 47 | +| common-options | config | No | - | |
| 48 | + |
| 49 | +### token [String] |
| 50 | + |
| 51 | +Airtable personal access token. You can create one at https://airtable.com/create/tokens. |
| 52 | + |
| 53 | +### base_id [String] |
| 54 | + |
| 55 | +The ID of the Airtable base (starts with `app`). |
| 56 | + |
| 57 | +### table [String] |
| 58 | + |
| 59 | +The table name or table ID to read from. |
| 60 | + |
| 61 | +### api_base_url [String] |
| 62 | + |
| 63 | +Airtable API base URL. Default is `https://api.airtable.com`. |
| 64 | + |
| 65 | +### view [String] |
| 66 | + |
| 67 | +The name or ID of a view in the table. Only records visible in this view will be returned. |
| 68 | + |
| 69 | +### fields [List] |
| 70 | + |
| 71 | +A list of field names to include in the response. |
| 72 | + |
| 73 | +### filter_by_formula [String] |
| 74 | + |
| 75 | +An Airtable formula to filter records. See [Airtable formula reference](https://support.airtable.com/docs/formula-field-reference). |
| 76 | + |
| 77 | +### max_records [int] |
| 78 | + |
| 79 | +Maximum total number of records to return. |
| 80 | + |
| 81 | +### page_size [int] |
| 82 | + |
| 83 | +Number of records per page (1-100). |
| 84 | + |
| 85 | +### sort [String] |
| 86 | + |
| 87 | +Sort definition as a JSON array, e.g. `[{"field":"Name","direction":"asc"}]`. |
| 88 | + |
| 89 | +### cell_format [String] |
| 90 | + |
| 91 | +The format for cell values, either `json` or `string`. |
| 92 | + |
| 93 | +### return_fields_by_field_id [boolean] |
| 94 | + |
| 95 | +If true, field keys in the response will be field IDs instead of field names. |
| 96 | + |
| 97 | +### record_metadata [List] |
| 98 | + |
| 99 | +Additional record metadata to return, e.g. `["commentCount"]`. |
| 100 | + |
| 101 | +### time_zone [String] |
| 102 | + |
| 103 | +The time zone for formatting date/time values. |
| 104 | + |
| 105 | +### user_locale [String] |
| 106 | + |
| 107 | +The user locale for formatting values. |
| 108 | + |
| 109 | +### request_interval_ms [int] |
| 110 | + |
| 111 | +Minimum interval in milliseconds between API requests. Default 220ms (to stay within Airtable's 5 requests/second limit). |
| 112 | + |
| 113 | +### rate_limit_backoff_ms [int] |
| 114 | + |
| 115 | +Base backoff time in milliseconds when receiving a 429 (rate limit) response. Default 30000ms. |
| 116 | + |
| 117 | +### rate_limit_max_retries [int] |
| 118 | + |
| 119 | +Maximum number of retries after receiving a 429 response. Default 3. |
| 120 | + |
| 121 | +### schema [Config] |
| 122 | + |
| 123 | +#### fields [Config] |
| 124 | + |
| 125 | +The schema fields of upstream data. For more details, please refer to [Schema Feature](../../introduction/concepts/schema-feature.md). |
| 126 | + |
| 127 | +### format [String] |
| 128 | + |
| 129 | +The format of upstream data, supports `json` and `text`, default `text`. |
| 130 | + |
| 131 | +### content_field [String] |
| 132 | + |
| 133 | +JsonPath expression to extract data from the response. For Airtable, you typically use `$.records[*].fields` to extract the fields from each record. |
| 134 | + |
| 135 | +### json_field [Config] |
| 136 | + |
| 137 | +This parameter helps you configure the schema and must be used with schema. |
| 138 | + |
| 139 | +### common options |
| 140 | + |
| 141 | +Source plugin common parameters, please refer to [Source Common Options](../common-options/source-common-options.md) for details. |
| 142 | + |
| 143 | +## Example |
| 144 | + |
| 145 | +Read from an Airtable table and output raw text: |
| 146 | + |
| 147 | +```hocon |
| 148 | +source { |
| 149 | + Airtable { |
| 150 | + token = "patXXXXXXXX.XXXXXXXX" |
| 151 | + base_id = "appXXXXXXXX" |
| 152 | + table = "Shipments" |
| 153 | + format = "text" |
| 154 | + max_records = 10 |
| 155 | + } |
| 156 | +} |
| 157 | +``` |
| 158 | + |
| 159 | +Read with schema and extract record fields: |
| 160 | + |
| 161 | +```hocon |
| 162 | +source { |
| 163 | + Airtable { |
| 164 | + token = "patXXXXXXXX.XXXXXXXX" |
| 165 | + base_id = "appXXXXXXXX" |
| 166 | + table = "Shipments" |
| 167 | + content_field = "$.records[*].fields" |
| 168 | + filter_by_formula = "{Status} = 'Shipped'" |
| 169 | + schema = { |
| 170 | + fields { |
| 171 | + Name = string |
| 172 | + Status = string |
| 173 | + Weight = float |
| 174 | + } |
| 175 | + } |
| 176 | + } |
| 177 | +} |
| 178 | +``` |
| 179 | + |
| 180 | +## Changelog |
| 181 | + |
| 182 | +<ChangeLog /> |
0 commit comments