Scripting
Model

Cursor
Scripting Extension only

A Cursor contains information about the state of the user's current interactions in Airtable - specifically, their active table and active view.

Example
let tableId = cursor.activeTableId;
let table = base.getTable(tableId);
console.log(`The name of my current active table is ${table.name}.`);

activeTableId

typedef
TableId | null

The currently active table ID. Can be null if the active table is still loading in the Airtable UI.

Example
// inspect the active table:
let tableId = cursor.activeTableId;
let table = base.getTable(tableId);
console.log(table);

activeViewId

typedef
ViewId | null

The currently active view ID. This will always be a view belonging to activeTableId. Can be null when the active view has changed and is not yet loaded, and can also refer to a view that is not yet loaded.

Example
// inspect the active view:
let table = base.getTable(cursor.activeTableId);
let viewId = cursor.activeViewId;
let view = table.getView(viewId);
console.log(view);