Formulas: List() and ListCombine()
Category: Lists (Arrays)
List()
Turns a set of values into a list
or stated otherwise...
Hey Coda, can you turn all of these values I provided into a list?
ListCombine()
Merges different lists into a single list
put a bit simpler...
Hey Coda, here’s a set of lists. Can you combine them and turn them into a new, single list? Both List() and ListCombine() take the same, single parameter. That parameter is called Value, but it is actually a repeating parameter. Specifically this means that you can input as many or as few values as you would like to create new lists.
Value
List/ListCombine(Value. . .)
The string of text, numbers, etc. that you want to combine into a list, with each item separated by a comma.
List()
List() allows you to manually create a list out of values. Take this GIF for example:
And here’s the list:
ListCombine()
ListCombine() is a bit more useful in Coda than List() alone, so we will spend a little more time on this one. Watch how list combine takes these two lists below and merges them into a single list.
See the lists separatecombined
But why is this helpful?
Let’s say you had a table called “Projects” and you wanted your team to sign-up to be involved in a project.
Normally, you might think this would be a regular ModifyRows() action inside a button that sets the column value to user() (like in the blue button below). But it actually doesn't! It will override every value in that column with the current user
Try the blue button that looks like this and notice what it does: Why doesn’t the blue button work? The blue button below, which is set up like this screenshot, will actually just over-ride every single value in the Assignees column with the current user regardless of what is already in there. It simply is saying: “Hey Coda, change the Assignees column to my own User chip”
This will obviously only work correctly the first time someone presses it, but anytime after that it will clear the whole cell and any previous individuals who signed up
Now try the white button that looks like this below → Why does the white button work? What the white button is doing is a ListCombine() - It is essentially saying: “Hey Coda, can you take whatever values are currently in the Assignees column, then take my personal user value, and combine them into one NEW list? Then set that NEW list as the value for the column.”