Data Table
39 commands. Toolkit id ooa.datatable.
| Command | What it does |
|---|---|
| Add column from list | Add 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 row | Append a row: a Dictionary of column values, or a List of values in column order. |
| Change column type | Convert every value in a column to String, Number, DateTime or Boolean; empty cells stay empty. |
| Clear rows | Remove every row but keep the columns. |
| Column contains value | True when any row has this value in the column. |
| Column count | Number of columns. |
| Column count is | Compare the number of columns with a number. |
| Column name | Return the name of the column at a zero-based index. |
| Column names | List the column names in order. |
| Column to list | Return the values of one column as a list, e.g. every invoice number. |
| Convert to CSV text | Turn 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 table | Turn 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 records | Turn each row into a dictionary keyed by column name. |
| Create empty table | Make a table with the columns you name (or a number of columns) and a number of empty rows, ready to fill. |
| Create from CSV text | Build 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 records | Build a table from a list of dictionaries. |
| Delete column | Remove a column and its values. |
| Delete rows | Delete the row at a position, or every row where a column equals a value. |
| Filter rows | Keep (or remove) the rows that meet one or more conditions on their columns, and keep only the columns you need. |
| Find value | Return the zero-based numbers of rows containing a value, in one column or in any column. |
| Get value | Read one cell by zero-based row number and column name. |
| Group and summarise | Group 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 column | Add 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 row | Insert a row, given as a dictionary of column values, at a zero-based position. |
| Join tables | Combine two tables on matching key columns; inner keeps matches only, left keeps every row of the first table. |
| Look up value | Find the first row whose column holds a value and return another column of that row, or a fallback value when no row matches. |
| Merge tables | Stack the rows of several tables; columns are matched by name, using the union of all columns or requiring the same ones. |
| Remove duplicate rows | Keep the first row for each distinct value of the chosen columns (all columns when empty). |
| Remove empty rows | Drop the rows in which every cell is empty (or only spaces). |
| Rename column | Give a column a new name; its values stay as they are. |
| Replace values | Replace text in the cells of one column or of every column: inside the cell text, or whole cells only. |
| Row count | Number of rows. |
| Row count is | Compare the number of rows with a number, e.g. more than 0 rows. |
| Set value | Change one cell. |
| Sort | Sort rows by a column. |
| Sum column | Add 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 column | True when the table has a column with this name. |
| Table is empty | True when the table has no rows. |
| Write to file | Save a table as a CSV file or as a JSON list of records, replacing the file. |