Extensions

Press shift + S to search API reference.

Interface

Aggregator

View source

Aggregators can be used to compute aggregates for cell values.

import {aggregators} from '@airtable/blocks/models';
// To get a list of aggregators supported for a specific field:
const fieldAggregators = myField.availableAggregators;
// To compute the total attachment size of an attachment field:
const aggregator = aggregators.totalAttachmentSize;
const value = aggregator.aggregate(myRecords, myAttachmentField);
const valueAsString = aggregate.aggregateToString(myRecords, myAttachmentField);
interface Aggregator
displayNamestring

A user friendly name for this aggregator that can be displayed to users.

keyAggregatorKey

A unique key for this aggregator that can be used to identify it in code.

shortDisplayNamestring

A short user friendly name for this aggregator that can be displayed to users.

aggregate
function (records: Array<Record>, field: Field) => unknown

Aggregates the value of field in each of records to produce a single value.

aggregateToString
function (records: Array<Record>, field: Field) => string

Aggregates the value of field in each of records to produce a single value, formatted as a string.