Lists and tables
Columns with several values as lists: split, count, filter, sort, look up, calculate on every item, join; tables of items with their columns.
Many columns hold several values: Dropdown and Tags (Red, Blue), People, Connect boards, Mirror, Files, Subitems. A Long text can hold several lines. In the new automation blocks these can be handled as lists: counted, filtered, sorted and calculated item by item, then joined back into one text.
The list functions
They take the list first and work directly on a column with several values: the separator (, ; line breaks |) is found by itself.
| Function | Gives | With Tags = Red, Green, red, Blue |
|---|---|---|
LIST.COUNT(list) |
How many items | 4 |
LIST.FIRST(list), LIST.LAST(list) |
The first, the last | Red, Blue |
LIST.ITEM(list, n) |
The n-th; -1 is the last, -2 the one before | LIST.ITEM({Tags}, 2) → Green |
LIST.UNIQUE(list) |
Each item once (upper and lower case count as the same) | Red, Green, Blue |
LIST.SORT(list, ["desc"]) |
In order, A to Z and smaller to larger; "desc" reverses |
Blue, Green, Red, red |
LIST.REVERSE(list) |
Backwards | Blue, red, Green, Red |
LIST.CONTAINS(list, value) |
TRUE if the value is there (any case) | LIST.CONTAINS({Tags}, "blue") → TRUE |
LIST.POSITION(list, value) |
Its position, 0 if it isn’t there | LIST.POSITION({Tags}, "Green") → 2 |
LIST.REMOVE(list, value, …) |
Without those values (any case) | LIST.REMOVE({Tags}, "red") → Green, Blue |
LIST.TAKE(list, n), LIST.SKIP(list, n) |
The first n; all but the first n (negative n: from the end) | LIST.TAKE({Tags}, 2) → Red, Green |
LIST.COMBINE(list1, list2, …) |
One list after the other | LIST.COMBINE({Tags}, "Yellow") |
LIST.WHERE(list, x, condition) |
The items for which the condition is TRUE; x stands for each item |
LIST.WHERE({Tags}, t, LEFT(t, 1) = "R") → Red, red |
LIST.EACH(list, x, calculation) |
The calculation for each item | LIST.EACH({Tags}, t, LEN(t)) → 3, 5, 3, 4 |
LIST.LOOKUP(value, where, what, [if missing]) |
The item of “what” in the position where value is found in “where” | see below |
LIST.SPLIT(text, [separator]) |
A list from a text | LIST.SPLIT("a/b/c", "/") |
LIST.JOIN(list, [separator]) |
One text, empty items skipped; , by default |
LIST.JOIN({Tags}, " / ") |
x in LIST.WHERE and LIST.EACH can be any name: tag, p, email.
Calculating on every item
Operators and functions given a list work on each item, so there’s often no need for LIST.EACH:
=SUM(VALUE(LIST.SPLIT({Prices})) * 1.22) → the total of the prices plus VAT
=UPPER(LIST.SPLIT({Tags})) → every tag in capitals
=IF(VALUE(LIST.SPLIT({Scores})) >= 60, "pass", "fail")
SUM, AVERAGE, MAX, COUNTA and the other totals take the whole list (see Numbers and totals). Text functions are in Texts, date functions in Dates.
Writing a list
A list written into a column becomes one text, its items separated by , . Use LIST.JOIN to choose the separator, for example "; " for several emails, or CHAR(10) for one item per line in a Long text column.
Step by step
The list functions read well one after the other. After a dot, .WHERE, .SORT, .JOIN and the others are the LIST functions:
={Tags}.UNIQUE().SORT().JOIN(" / ") → Blue / Green / Red
={Tags}.WHERE(t, t.LEFT(1) = "R").COUNT() → 2
={Emails}.WHERE(e, e.AFTER("@") = "acme.com").JOIN("; ")
Looking up a value
Two lists in the same order work as a small table. LIST.LOOKUP(value, where, what) finds value in the first and gives what is in the same position in the second:
=LIST.LOOKUP({Country}, "IT, FR, DE", "22, 20, 19") → the VAT rate of the country
Tables of items
MONDAY.ITEMS(column, "Status", "Price") gives the connected items as a table, and MONDAY.GROUP.ITEMS(…) / MONDAY.BOARD.ITEMS(…) the items of the group or of the board (see monday items, people and boards). The first row holds the column names: Name, then the columns you asked for. These functions use them:
| Function | Gives | Example |
|---|---|---|
TABLE.COLUMN(table, "Price") |
A column of the table, as a list | SUM(VALUE(TABLE.COLUMN(MONDAY.ITEMS({Orders}, "Amount"), "Amount"))) |
TABLE.WHERE(table, "Status", "Done") |
The rows with that value (any case), header included | TABLE.COUNT(TABLE.WHERE(MONDAY.ITEMS({Tasks}, "Status"), "Status", "Done")) |
TABLE.LOOKUP(table, "Name", "Beta", "Price") |
The Price in the row whose Name is Beta, empty if none | |
TABLE.COUNT(table) |
How many rows, the header excluded |
A table written into a column becomes one line per row, the header included.
Functions you may know from spreadsheets
Who knows spreadsheets can use the same functions, with their usual arguments:
| Function | Plain name |
|---|---|
TEXTJOIN(separator, TRUE, list) |
LIST.JOIN |
FILTER(list, condition, [if none]) |
LIST.WHERE |
SORT(list, [column], [1 or -1]), SORTBY(list, by, [1 or -1]) |
LIST.SORT |
UNIQUE(list) |
LIST.UNIQUE |
TAKE, DROP |
LIST.TAKE, LIST.SKIP |
SEQUENCE(rows, [columns], [start], [step]) |
LET names a value so it is written once, and LAMBDA writes a calculation that MAP, REDUCE and SCAN apply:
=LET(prices, VALUE(LIST.SPLIT({Prices})), MAX(prices) - MIN(prices))
=MAP(LIST.SPLIT({Tags}), LAMBDA(t, LEN(t)))
The functions that work on a grid of cells (VLOOKUP, XLOOKUP, TEXTSPLIT, TRANSPOSE, VSTACK…) are left out of the new automation blocks, since monday has no grid: to find a value use LIST.LOOKUP, or TABLE.LOOKUP on the items of the board. A calculation is limited to 10,000 values; a larger list gives a Can’t calculate error (#CALC!).
MONDAY.LIST.FIRST, MONDAY.LIST.LAST, MONDAY.LIST.ITEM and MONDAY.LIST.UNIQUE, from the first version of these functions, keep working and give a text.
In the older recipes
There, several values arrive joined by + (Red+Blue) and can’t be used as lists. Totals of several values work with the MONDAY functions, such as MONDAY.NUMBER.SUM (see Numbers and totals). Lists come with the new automation blocks.