Add Data Row
Add Data Row
Section titled “Add Data Row”Type: add-row · Package: DataTable Activities v1.0.0 · Output: DataRow
Adds a new row at the end of a DataTable and returns the created row.
How it works
Section titled “How it works”Creates a row with the values you provide and appends it to the table. Returns the created DataRow, so you can keep working on it with Set Cell or Update Data Row.
The values are given in two forms (a toggle in the editor):
- By column — a dictionary
{ column: value }. Order-independent; validates the column name. - By position — a list of values in column order. You must provide exactly one value per column.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
table | expression | The DataTable to append the row to, e.g. = customers. |
values | row values | The row values, by column { column: value } or by position [v1, v2, …]. |
Optional parameters
Section titled “Optional parameters”None.
Output
Section titled “Output”Returns the newly created DataRow.
Example
Section titled “Example”Build a table and add rows in both ways:
Build DataTable data: [ { id: 1, name: "Ana", age: 30 } ] → output: people
Add Data Row table = = people values (by column): { id: 2, name: "Luis", age: 25 } → output: rowAdd Data Row table = = people values (by position): [ 3, "Carla", 28 ]
Log message = = "The table has " + rowCount(people) + " rows"Related activities
Section titled “Related activities”- Build DataTable — create the table you add rows to.
- Set Cell / Update Data Row — modify the returned row.
- Data Types › DataRow — what a row is.