Lookup Table with Unique Names Only


#1

I have this table, which shows all the different Units I can build. When I select the dropdown, however, the list that it offers is really really long.

How can I make this only offer the unique Unit Types from other unit tables?


#2

Can you show what the unit table looks like that you’re pulling the select options from?


#3

@cnr

The fact that the table you are looking up has so many identical values in the Display column is something you might want to ponder. As a general rule, you give yourself more options with the rest of your build if the Display column is a unique value.

Then again, it may not matter at all.

Selectable Options in the image is: types.type.Unique()



#4

@cnr

I just played with this some more and it looks like you don’t even need .Unique(). That seems to be built into Coda’s ‘Select list’ algo.

To see this better, set up two Select columns and enter these Select options, one in each column:
types
types.type

The first references a table and returns a list of the table’s rows, and since every row is unique under the hood, it returns “duplicates” (because they aren’t really duplicates).

The second returns only uniques.

The reason you’re getting all the duplicates in your list is because you’re using a Lookup column which references all the rows in the Lookup table, and since each row is unique under the hood, it returns every row in your drop down list. This relates to what I said earlier about having unique values in your Display column.