Add rows
Appends multiple rows details to the table.
Adds multiple rows to the table instance.
Parameter
| Parameters | Type | Description |
|---|---|---|
| Payload | Array | Array of objects where keys represent the columnId(string) and its values correspond to the respective field types (like number for rating/slider, string for text/textarea etc.). |
Syntax
tableInstance.addRows([
{ columnId1: value, columnId2: value }, // row 1
{ columnId1: value, columnId2: value }, // row 2
]);Example
Assume employeeData variable is fetched via an api call.
const worktableInstance = kf.context.getTable(tableId);
let accumulator = [];
employeeData.forEach(function(data) {
accumulator.push({
table_field1: data[“Company”],
table_field2: data[“YOE”]
});
});
await worktableInstance.addRows(accumulator);

