With all of Coda’s power and flexibility comes great responsibility...to modify multiple select lists within tables efficiently. The formula we’ll use in our table button is actually pretty simple, but the WHY behind it is a bit quirky. Stick with me, and I’ll walk you through it!
First, what are we trying to do? We’re trying to modify the value of a column by pressing a button. It seems easy enough, but when the column you want to modify is a multiple select list, things get a bit tricky.
So, in order to add a pre-determined value to a multi-select list in a Coda table, follow these three steps:
1. Find a Coda doc (or create one) with a table that has a column tagged as a multiple select list. Hint: you’ll know if you have a column that will work for this if the column type is a “Select list” or a “Relation” and in the “Column options,” you must “Allow multiple selections.” Also, the list items will be seen as a “chip” and not just text.
2. Add a button type column to the table. In the button column options, choose “Modify rows” for the On click action, choose the name of your table for the Table dropdown, and choose “This Row” for the Apply to dropdown.
3. Now for the list values that we’re going to update. In the Update Values section, choose the column you want to modify. Type the equals symbol (=) and use the following formula: ListCombine(thisRow.[ColumnName],[ListValueChipToAdd]).Filter([CurrentValue].IsNotBlank())
This simple button formula ensures that the common mistakes below don’t plague your tables:
- Updating the value of the column to just text. This won’t work on a multi select list because the list items are Coda “chips.”
- Putting only one of the list values in the “Update value” section will override the values that are currently in the column.
- Using the ListCombine() formula without the Filter() formula to account for an already blank column value, will create a modified column value that literally says, “Blank”.
To see a quick walkthrough with a real use-case, check out my YouTube video!
Enjoyed learning more about Coda with this post and want to learn more? From Coda lover to Coda lover, we've selected some other interesting and useful resources we think you'll love. Check them below👇