Add Column
Add Column
Section titled “Add Column”Type: add-column · Package: DataTable Activities v1.0.0 · Output: DataTable
Adds a new calculated column to a DataTable: For each row, evaluates an expression and saves the result to the column. Use it to derive data from existing data — a total with VAT, a category, an “overdue” mark, a combined text.
How it works
Section titled “How it works”Steps through the table row by row evaluating the expression value. Row columns are available as variables within that expression: you can reference them by name directly. Returns a new table with the added column.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
table | expression | The DataTable to extend. |
column | text | Name of the new column. |
value | expression | Expression evaluated on each row. The columns of the row are injected as variables. |
Optional parameters
Section titled “Optional parameters”Ninguno.
Output
Section titled “Output”Returns a DataTable with the column added.
Example
Section titled “Example”Add a column TotalConIva from column Total:
Add Column table = = facturas column = "TotalConIva" value = = num(Total) * 1.19 → output: conIvaHere Total refers to column Total of the current row. Wrap it in num(...) or str(...) to safely handle the cell value.
Add Column table = = clientes column = "Saludo" value = = "Estimado/a " + str(Nombre) → output: conSaludoRelated activities
Section titled “Related activities”- Drop Column — delete columns.
- Rename Column — rename a column.
- Aggregate Column — summarize a numeric column.