Skip to main content

Data Table

39 commands. Toolkit id ooa.datatable.

CommandWhat it does
Add column from listAdd a column at the start, the end or a zero-based position, filled with the items of a list row by row; a longer list adds rows.
Add rowAppend a row: a Dictionary of column values, or a List of values in column order.
Change column typeConvert every value in a column to String, Number, DateTime or Boolean; empty cells stay empty.
Clear rowsRemove every row but keep the columns.
Column contains valueTrue when any row has this value in the column.
Column countNumber of columns.
Column count isCompare the number of columns with a number.
Column nameReturn the name of the column at a zero-based index.
Column namesList the column names in order.
Column to listReturn the values of one column as a list, e.g. every invoice number.
Convert to CSV textTurn a table into CSV text in a variable, for an e-mail, an API call or a message, without writing a file.
Convert to HTML tableTurn a table into an HTML <table> for an e-mail body or a report; cell text is escaped so it shows as written.
Convert to recordsTurn each row into a dictionary keyed by column name.
Create empty tableMake a table with the columns you name (or a number of columns) and a number of empty rows, ready to fill.
Create from CSV textBuild a table from CSV text held in a variable (for example an e-mail body or an API answer), with quoted fields understood.
Create from recordsBuild a table from a list of dictionaries.
Delete columnRemove a column and its values.
Delete rowsDelete the row at a position, or every row where a column equals a value.
Filter rowsKeep (or remove) the rows that meet one or more conditions on their columns, and keep only the columns you need.
Find valueReturn the zero-based numbers of rows containing a value, in one column or in any column.
Get valueRead one cell by zero-based row number and column name.
Group and summariseGroup rows by one or more columns and compute count, sum, average, minimum, maximum, first or last per group; without group columns, one summary row.
Insert columnAdd a column at the end or at a zero-based position, filled with a default value or with the values of a column of another table.
Insert rowInsert a row, given as a dictionary of column values, at a zero-based position.
Join tablesCombine two tables on matching key columns; inner keeps matches only, left keeps every row of the first table.
Look up valueFind the first row whose column holds a value and return another column of that row, or a fallback value when no row matches.
Merge tablesStack the rows of several tables; columns are matched by name, using the union of all columns or requiring the same ones.
Remove duplicate rowsKeep the first row for each distinct value of the chosen columns (all columns when empty).
Remove empty rowsDrop the rows in which every cell is empty (or only spaces).
Rename columnGive a column a new name; its values stay as they are.
Replace valuesReplace text in the cells of one column or of every column: inside the cell text, or whole cells only.
Row countNumber of rows.
Row count isCompare the number of rows with a number, e.g. more than 0 rows.
Set valueChange one cell.
SortSort rows by a column.
Sum columnAdd up the numeric values in a column; empty cells are ignored, and text such as 1,000.50 or $ 12 is read as a number.
Table has columnTrue when the table has a column with this name.
Table is emptyTrue when the table has no rows.
Write to fileSave a table as a CSV file or as a JSON list of records, replacing the file.