Skip to content

Rows

Row operations on the seatable-html-page-sdk. All methods are asynchronous — await them. The sdk instance below is created and initialized as shown in Initialization.

Response format

Row methods resolve to the underlying HTTP response — the payload is under .data, not the return value itself. For example, listRows gives you the rows via res.data.results and the column metadata via res.data.metadata. The Returns sections below describe the shape of .data.

Single- and multi-select values

Single-select and multi-select fields — including those returned via linked records and lookup formulas — return the option names, not their internal IDs.

List rows

listRows

List rows from a specific table, with pagination.

sdk.listRows({ tableName, start, limit });

Parameters

tableName
string — name of the target table
start
number — starting index for pagination
limit
number — number of rows to retrieve

Returns .data holds { metadata, results }results is the array of row objects, metadata the column definitions.

Example

const res = await sdk.listRows({ tableName: "Employees", start: 0, limit: 50 });
const rows = res.data.results;
const columns = res.data.metadata;

Add rows

addRow

Add a new row to the specified table.

sdk.addRow({ tableName, rowData });

Parameters

tableName
string — name of the target table
rowData
object — key-value pairs of column names and values

Returns .data holds { row } — the newly created row object.

Example

const res = await sdk.addRow({
  tableName: "Employees",
  rowData: {
    Name: "Jane Smith",
    Age: 28,
    Department: "Engineering",

    // IDs of records linked in the Manager field
    Manager: ["NSPa_fd4SEqRESqOZzRqyg", "eA6rQDuxQyGITmD1hrfyzw"],
  },
});

Linked record fields

Set a link column with { "link_column_name": ["linked_row_id1", "linked_row_id2", ...] }.

batchAddRows

Add multiple rows to the specified table in one call.

sdk.batchAddRows({ tableName, rowsData });

Parameters

tableName
string — name of the target table
rowsData
array — an array of row objects

Returns .data holds { rows } — the list of created row objects. Each row carries its new _id, which you can use to populate link fields in a follow-up call.

Example

await sdk.batchAddRows({
  tableName: "Employees",
  rowsData: [
    {
      Name: "Jane Smith",
      Age: 28,
      Department: "Engineering",
      Manager: ["NSPa_fd4SEqRESqOZzRqyg", "eA6rQDuxQyGITmD1hrfyzw"],
    },
    {
      Name: "Tom",
      Age: 24,
      Department: "Product Management",
      Manager: ["QgK2KMf8Sxad8duPcq6gQA", "bBDbhbzXReSPWpcxq225xA"],
    },
  ],
});

Update rows

updateRow

Update an existing row.

sdk.updateRow({ tableName, rowId, rowData });

Parameters

tableName
string — name of the target table
rowId
string — the unique ID of the row to update
rowData
object — the fields to update

Returns .data holds { success: true, row: {...} }

Example

await sdk.updateRow({
  tableName: "Employees",
  rowId: "fcHIocncTsOygA3FjL-toQ",
  rowData: { Age: 18 },
});

batchUpdateRows

Update multiple rows in one call.

sdk.batchUpdateRows({ tableName, rowsData });

Parameters

tableName
string — name of the target table
rowsData
array — objects containing a row_id and the updated row data

Returns .data holds { success: true, rows: [{...}, ...] }

Example

await sdk.batchUpdateRows({
  tableName: "Employees",
  rowsData: [
    { row_id: "fcHIocncTsOygA3FjL-toQ", row: { Age: 18 } },
    { row_id: "BIXJ_dUMS1OW8Lyoxrx4Fw", row: { Age: 24 } },
  ],
});

Delete rows

deleteRow

Delete a single row.

sdk.deleteRow({ tableName, rowId });

Parameters

tableName
string — name of the target table
rowId
string — the unique ID of the row to delete

Returns .data holds { success: true }

Example

await sdk.deleteRow({
  tableName: "Employees",
  rowId: "fcHIocncTsOygA3FjL-toQ",
});

batchDeleteRows

Delete multiple rows in one call.

sdk.batchDeleteRows({ tableName, rowsIds });

Parameters

tableName
string — name of the target table
rowsIds
array — the row IDs to delete

Returns .data holds { success: true }

Example

await sdk.batchDeleteRows({
  tableName: "Employees",
  rowsIds: ["fcHIocncTsOygA3FjL-toQ", "BIXJ_dUMS1OW8Lyoxrx4Fw"],
});