Skip to content

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.

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.

ParameterEditorDescription
columnsarregloColumn names: ["Cliente", "Total"].
ParameterEditorDescription
rowsarregloRows as arrays: [["Ana", 100], ["Luis", 200]].
columnTypesarregloExplicit types per column, e.g. ["string", "double"]. If omitted, they are inferred from the first value.

Returns a DataTable with the indicated columns and rows.

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 = = resumen