Add one or more rows with data to an existing table.
const result = await client.tables.createRows("tbl_abc123", {
rows: [
{ name: "Widget A", price: 9.99, brand: "Acme" },
{ name: "Widget B", price: 14.99, brand: "Acme" },
],
});
console.log(result.inserted_count); // 2
for (const row of result.data) {
console.log(row.id, row.data.name);
}
{
"data": [
{
"id": "row_def456",
"row_index": 5,
"data": {
"name": "Widget A",
"price": 9.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
},
{
"id": "row_ghi789",
"row_index": 6,
"data": {
"name": "Widget B",
"price": 14.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"inserted_count": 2
}
Show Row object
name (text) and price (number), a valid row would be { "name": "Widget", "price": 9.99 }.422 error listing the unknown keys.const result = await client.tables.createRows("tbl_abc123", {
rows: [
{ name: "Widget A", price: 9.99, brand: "Acme" },
{ name: "Widget B", price: 14.99, brand: "Acme" },
],
});
console.log(result.inserted_count); // 2
for (const row of result.data) {
console.log(row.id, row.data.name);
}
{
"data": [
{
"id": "row_def456",
"row_index": 5,
"data": {
"name": "Widget A",
"price": 9.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
},
{
"id": "row_ghi789",
"row_index": 6,
"data": {
"name": "Widget B",
"price": 14.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"inserted_count": 2
}
const result = await client.tables.createRows("tbl_abc123", {
rows: [
{ name: "Widget A", price: 9.99, brand: "Acme" },
{ name: "Widget B", price: 14.99, brand: "Acme" },
],
});
console.log(result.inserted_count); // 2
for (const row of result.data) {
console.log(row.id, row.data.name);
}
{
"data": [
{
"id": "row_def456",
"row_index": 5,
"data": {
"name": "Widget A",
"price": 9.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
},
{
"id": "row_ghi789",
"row_index": 6,
"data": {
"name": "Widget B",
"price": 14.99,
"brand": "Acme"
},
"created_at": "2025-03-10T14:30:00.000Z"
}
],
"inserted_count": 2
}