Sometimes the selections we'll need in a column will depend on choices we make elsewhere in our tables. For example, in a shopping list I have categories:

  • Fruit
  • Vegetables
  • Dairy

And each of these categories have the following choices:

  • Fruit → Apple, Orange, Banana
  • Vegetable → Tomato, Potato, Carrot
  • Dairy → Milk, Butter, Eggs

Rather than selecting each of these manually, I can set up my table to that my options reflect the choice I make for the category.  For example, if I select Fruit in a column, I would only see Apple, Orange, and Banana as options.

There are two ways to accomplish this in Coda. Let's explore the options.

Option 1 - Simple select column of categories

  1. Create a new table Catalog which will store your item inventory.   Give the table two columns to start -  Category and Item.    
  2. Set the Display Column to Item
  3. Create another table Shopping List which will store the selectable items
  4. Add a select list column called Category.   Leave the selectable options blank - as you type new values they will be automatically saved.
  5. Add a second select list column and name it Item.   Set the selectable options formula to Catalog.Filter(thisRow.Category = Category)
  6. Now start adding rows into the Shopping List table.  You can pick existing values or new values for the category.   Then, in the Item column, you can pick an existing item for the selected category or type to add a new item.   
  7. These new items are automatically added to your Catalog table.

Option 2: Linked table of categories

  1. Create a new table called Categories to store your category names.
  2. Create a new table called Catalog which will store your item inventory.   Give this table two columns, Category and Item.    
  3. Set the Display Column to Item.    
  4. Set the Category column to be a lookup column to the Categories table
  5. Create another table Shopping List which will store your selected items
  6. Add a select list column and name it Category.  
  7. Set the Category column as a linked column to the Categories table.
  8. Add a second select list column and name it Item,    Set the selectable options formula to Catalog.Filter(thisRow.Category = Category)
  9. Now start adding rows into the Shopping List table.  You can pick existing values or new values for the category.   Then, in the Item column, you can pick an existing item for the selected category or type to add a new item.   
  10. When you enter a new category, you'll notice new rows are added to your Categories table.    Adding a new item also adds new rows to your Catalog table.
Did this answer your question?