Choice Component - allow key display pairs

In the interest of some kind of data normalization and using key links in your tables/sheets it would be nice to display pretty text for the choice dropdown but save a key value to the database/sheet. This is more in line with how it is implemented in HTML which is what is ultimately driving things under the covers. This is the idea I’m talking about. The user would see the long text but the save would be the shorter. All that you would have to do is allow the user to optionally select a second column of data for the key values.

<select>
  <option value="ford">Ford Motor Company</option>
  <option value="saab">Saab International</option>
  <option value="opel">Opel (are you kidding me?)</option>
  <option value="audi">Audi Motors</option>
</select>
4 Likes

I ran into scenarios where I’ve wanted this. Can’t think of any good ones of the top of my head. Definitely something I’m accustomed to as a web developer.

@david This could be incorporated into a Pro Choice component. You could also add to it the Search ability that others are asking for. So you would have a basic Choice component and then a Pro Choice component. As for a use case for the key pairs. By saving off the key instead of the text, it would facilitate later on not having to find all occurrences of the text in those related sheets that the dropdown feeds. I use a key for most everything so there is only one place needed to change the display text. Someone could even use this for adapting the app for different languages. All they would have to do is change the text in the table that has the key text pair and voila, you have French. (or Bien and you have both French and Spanish :slight_smile: )

@david I just thought of another feature that could be considered for this “Pro - Choice Component”. Allow for nested choices. Meaning once a choice is selected, as second list of choices would appear based on the prior chosen one. In other words, behind the scenes it would filter the next list of choices based on what was selected. I can’t picture the development interface at the moment but maybe someone could. I did see some Tutorial on how to pull it off within Google sheets but can’t find it at the moment. I have seen more than one request for this functionality. This one being the most recent:

1 Like

I think it would also be useful for Unique ID Special Value. I hope that it is not a pro component because I feel like it would discourage relationship editing.

I would love this capability. Having internal ids that are stable over time but presentable names for users would be great.