Skip to main content

airtable.listrecordsprops

Home > @runlightyear/airtable > ListRecordsProps

ListRecordsProps interface

Signature:
interface ListRecordsProps 

Required Properties

PropertyModifiersTypeDescription
baseIdstring
tableIdOrNamestring

Optional Properties

PropertyModifiersTypeDescription
cellFormat?"json" | "string"

The format that should be used for cell values. Supported values are:

json: cells will be formatted as JSON, depending on the field type. string: cells will be formatted as user-facing strings, regardless of the field type. The timeZone and userLocale parameters are required when using string as the cellFormat. Note: You should not rely on the format of these strings, as it is subject to change.

The default is json.

fields?Array<string>

Only data for fields whose names or IDs are in this list will be included in the result. If you don't need every field, you can use this parameter to reduce the amount of data transferred.

Note Airtable's API only accepts request with a URL shorter than 16,000 characters. Encoded formulas may cause your requests to exceed this limit. To fix this issue you can instead make a POST request to /v0/{baseId}/{tableIdOrName}/listRecords while passing the parameters within the body of the request instead of the query parameters.

filterByFormula?string

A formula used to filter records. The formula will be evaluated for each record, and if the result is not 0, false, "", NaN, [], or #Error! the record will be included in the response. We recommend testing your formula in the Formula field UI before using it in your API request.

If combined with the view parameter, only records in that view which satisfy the formula will be returned.

The formula must be encoded first before passing it as a value. You can use this tool to not only encode the formula but also create the entire url you need.

Note Airtable's API only accepts request with a URL shorter than 16,000 characters. Encoded formulas may cause your requests to exceed this limit. To fix this issue you can instead make a POST request to /v0/{baseId}/{tableIdOrName}/listRecords while passing the parameters within the body of the request instead of the query parameters.

maxRecords?numberThe maximum total number of records that will be returned in your requests. If this value is larger than pageSize (which is 100 by default), you may have to load multiple pages to reach this total.
offset?stringTo fetch the next page of records, include offset from the previous request in the next request's parameters.
pageSize?numberThe number of records returned in each request. Must be less than or equal to 100. Default is 100.
recordMetadata?Array<"commentCount">An optional field that, if specified, includes commentCount on each record returned.
returnFieldsByFieldId?boolean

An optional boolean value that lets you return field objects where the key is the field id.

This defaults to false, which returns field objects where the key is the field name.

sort?Array<{ field: string; direction: "asc" | "desc"; }>

A list of sort objects that specifies how the records will be ordered. Each sort object must have a field key specifying the name of the field to sort on, and an optional direction key that is either "asc" or "desc". The default direction is "asc".

The sort parameter overrides the sorting of the view specified in the view parameter. If neither the sort nor the view parameter is included, the order of records is arbitrary.

timezone?TimezoneThe time zone that should be used to format dates when using string as the cellFormat. This parameter is required when using string as the cellFormat.
userLocale?stringThe user locale that should be used to format dates when using string as the cellFormat. This parameter is required when using string as the cellFormat.
view?stringThe name or ID of a view in the table. If set, only the records in that view will be returned. The records will be sorted according to the order of the view unless the sort parameter is included, which overrides that order. Fields hidden in this view will be returned in the results. To only return a subset of fields, use the fields parameter.