DropDown Reference Using Second Column Not th...

ux
(Colin) #1

DropDown Reference Using Second Column Not the Key Column

I would like to please follow up on an unanswered question from October 2018 | Office Hours: Calendar View, Quick Edit Tables, True/False Toggle | October 2018 | Office Hours | AppSheet https://www.youtube.com/watch?v=16OcSQHVor8&t=2s

“I’m trying to make a dropdown that will reference the lists of names in my spreadsheet. The list of names are in the second column, Column B, in the spreadsheet. How do I have the tables reference the columns other than column A on the spreadsheet?”

(I am asking as I have a similar need. I am selecting from a dropdown of references where I want to see the list as items from the label of the referenced table, but I want the underlying name column value, not the key column value.)

Thank you for your feedback.

(Praveen Seshadri (AppSheet)) #2

A Reference only can refer to the key of the other table. Even though the values shown are the labels, the values stored are keys.

Instead, use TableName[ColumnName] or more generally SELECT(TableName[ColumnName], {filtercondition}) in the Valid-If constraint

You cannot choose to have Labels shown but the underlying values are a non-key column. This is because there is no guarantee that the mapping between the two is unique.

(Colin) #3

@praveen

“You cannot choose to have Labels shown but the underlying values are a non-key column. This is because there is no guarantee that the mapping between the two is unique.”

What if the columns are on the same row, in which the Key column is naturally unique?

A well-formatted label would probably include the key as part of it.

(Praveen Seshadri (AppSheet)) #4

@Colin, I apologize, I’m losing track of the underlying question.

You can always provide a list of values that are to be selected from. Ref is a special case where the list of values correspond to the keys of the other table. In this special case, when showing the Ref values in a dropdown, we show the label of the row rather than the key (because the key is sometimes only meaningfuo internally rather than to the end-user).