Convert-to-Array
Command Description
Convert a datatable to an array
Command Prototype
objDatatable = Datatable.GetDataTableByArray(dtTable,hasHead)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
dtTable | True | expression | objDatatable | The data table to be filtered |
hasHead | True | boolean | None | Whether to include headers after converting to an array |
return
objDatatable,The variable used to save the output of the command.
Demo
aryData = [["a", 1], ["b", 2], ["c", 3], ["d", 1]]
aryColumns = ["letter", "number"]
objDatatable = Datatable.BuildDataTable(aryData,aryColumns)
objDatatable = Datatable.GetDataTableByArray(objDatatable,true)
TracePrint(objDatatable)
// [["letter", "number"], ["a", 1], ["b", 2], ["c", 3], ["d", 1]]