Dropdown Menu Dependancies?

#1

Hi all,

Absolutely hooked on Coda, I’ve been using it for a couple of different purposes and loving it’s potential! I’ll try share a few things I’ve done so far that I really like soon. :slight_smile:

One thing I’ve yet to work out how to do (if it’s possible at all!) is how to setup dependancies for drop down menus.

What I mean by this is, say I have a table with two drop down columns. I would like the second dropdown column to only show relevant options based on what was set in the first dropdown.

EXAMPLE:
Say I’m creating a drinks menu, and the first dropdown has ‘drink type’ and contains options like Hot Drinks, Soft Drinks, Alcoholic Drinks. I’d like the the second dropdown provides options based on that choice - so if a user selects Hot Drinks in dropdown 1, dropdown 2 contains things like Cappuccino, Latte, Tea etc, but not for instance, Beer, Wine, Coca Cola.

Is that sort of functionality possible?

2 Likes
Filter results shown in a select control?
#2

Is this what you are looking for @Josh_Unwin1

3 Likes
Matches formula cannot match to a lookup field
#3

Hi Mallika, I’m not sure if that’s what Josh was looking for, but this has been what I’ve been wrestling with for the last half hour. Would be great if you could explain the steps here!

#4

@Stan_Schalij - here you go. Let me know if you need any breakdown or explanation here. I used an If statement in the Options Select List.

The formulas I used
Type column in Selection Table is a select list - [Drink Type].Type
Options is - If(Type.IsBlank(),[Drink Type].Drink ,[Drink Type].Filter(Type=thisRow.Type).Drink)

2 Likes
#5

Thanks so much for helping me! This works great, but sadly it breaks some other stuff: I think I can do a workaround with what you’ve thought me, but maybe you can help clear some it up:

Basically I’m running into problems when I try using the select list option with the Type being formatted as Lookup from Table. Recreating the shape of my setup with drinks:

  • In the Selections table I have a column called “Name”
  • In Drink Type I have a column called “Abbreviations”

Now, in my initial version I had “Type” formatted as Lookup from Table, allowing me to include [Drink Type].Abbreviations in the concenate I had in Selections.Name. (Including some other stuff from my version of the selections table). The Select List workaround seems to run into some problems when trying work with the lookup, and adding a big if statement for the abbreviations feels bloated.

I feel like the problem has something to do with the way the Filter is set up, but I’m not quite sure.

image

#6

Can you share this doc with support@coda.io and I’ll take a peek.

1 Like
#7

For the curious -

If [Selections].Type is a Lookup ( and not a select list as I have in my example) then is the the formula for Options is

If(Type.IsBlank(),[Drink Type].Drink ,[Drink Type].Filter(Type=thisRow.Type.Type)).Drink)

1 Like
#8

Sorry for the delayed reply @mallika thanks a lot, that is what I was looking for! I’ll have to experiment with this when I’m next working on that particular doc!

#9

And here is another way of doing this by making Type in both tables a Lookup -

2 Likes
#10

Hi. I’m having trouble to apply this to my Doc.
Probably I’m doing something wrong, I’m a beginner user.

Could you please take a look.
Also when I use Lookup format (from ‘Marca HD’ table) to the "Marca"column in the hard drive table I get the values twice…

I’m enjoying CODA a lot! I see so many possibilities!

Thank you

here’s the link to the doc:

#11

@Joana_Reis

See if this is what you want.

If so, study each table, column, and formula to see how it all connects.

#12

Hi Ander. Thanks a lot!
I noticed where I was wrong.

I was trying not to create more tables, but I got it now!

Thank you so much!
cheers from Brazil!

1 Like