I’m trying to find documentation for a feature I learned about quite a while ago. It is possible to control the text displayed for each option in a dropdown by returning a list of lists from the AllowedValuesDefinition. For example, the sample code below will create a dropdown field where selecting “Name 1” will set the field value to “id1”, while selecting “Name 2” will result in a field value of “id2”. I can’t find any documentation for this. I want to encourage developers I work with to prefer object ids over object names since names change and ids change… less. However, it will be a hard sell if I can’t find any indication that this is a supported feature.
Paul’s method is a good option. Another option is to create a hidden field in the form with a dependency reference on your “displayed” field and effectively translates the display-name to the id using a field value rule/script:
Thank you everyone! I chose Paul’s answer because although Alex’s answer has more info right in the reply, that documentation doesn’t state outright that you can return a list of lists (even though that is what the example code does). The Forms whitepaper specifically states that it can be a list of lists, gives an example of the list structure for a hard-coded set of AllowedValues, and then says that you can also return a list-of-lists from an AllowedValuesDefinition. It’s just a bit more obvious that this is documented behavior.