Scripting
Model

Record

A record belonging to a table in your base.

Get records in a table using table.selectRecordsAsync or in a view using view.selectRecordsAsync and using the resulting RecordQueryResult.

id

typedef
string

The unique ID of this record.

Example
let table = base.getTable("Tasks");
let queryResult = await table.selectRecordsAsync({fields: []});
let record = queryResult.records[0];
console.log(record.id);

getCellValue

function
function (fieldOrIdOrName: Field | string) => unknown;
Parameter nameDescription
fieldOrFieldIdOrFieldNameThe field (or ID or name) whose cell value you want to retrieve.

Gets a specific cell value in this record. See cell values & field options for the cell value format for each field type.

Example
let table = base.getTable("Tasks");
let queryResult = await table.selectRecordsAsync({fields: ["Description"]});
let record = queryResult.records[0];
console.log(record.getCellValue("Description"));

getCellValueAsString

function
function (fieldOrIdOrName: Field | string) => string;
Parameter nameDescription
fieldOrFieldIdOrFieldNameThe field (or ID or name) whose cell value you want to retrieve.

Gets a specific cell value in this record, formatted as a string.

Example
let table = base.getTable("Tasks");
let queryResult = await table.selectRecordsAsync({fields: ["Priority"]});
let record = queryResult.records[0];
console.log(record.getCellValueAsString("Priority"));

name

typedef
string

The primary cell value as a string, or 'Unnamed record' if primary cell value is empty.