Build DataTable
Build DataTable
Section titled “Build DataTable”Type: build-datatable · Package: DataTable Activities v1.0.0 · Output: DataTable
Creates a DataTable from scratch, defining its columns and, optionally, its initial rows. Use it when you need to build a table yourself—to accumulate results, prepare data to write in Excel, or put together a structure to which you will add rows—instead of reading it from a source.
How it works
Section titled “How it works”Define the columns with columns (a list of names) and, if you want, initial rows with rows (a list of rows, each an array of values). The type of each column is deduced from the first non-null value; you can force it with columnTypes.
Required parameters
Section titled “Required parameters”| Parameter | Editor | Description |
|---|---|---|
columns | arreglo | Column names: ["Cliente", "Total"]. |
Optional parameters
Section titled “Optional parameters”| Parameter | Editor | Description |
|---|---|---|
rows | arreglo | Rows as arrays: [["Ana", 100], ["Luis", 200]]. |
columnTypes | arreglo | Explicit types per column, e.g. ["string", "double"]. If omitted, they are inferred from the first value. |
Output
Section titled “Output”Returns a DataTable with the indicated columns and rows.
Example
Section titled “Example”Create a table with columns and some initial rows:
Build DataTable columns = = arr("Cliente", "Total") rows = = arr(arr("Ana", 100), arr("Luis", 200)) → output: resumen
Write Excel Sheet path = "C:/out/resumen.xlsx" data = = resumenRelated activities
Section titled “Related activities”- Add Column — add a calculated column to an existing table.
- Read Excel Sheet — get a DataTable from a file.