[SalesForce] How to reference Choice Value in formula instead of its label

I have a Picklist screen component in a Flow which has many choices defined in the same flow:

Screen component

Now I need to make a formula that references the Choice Value of a given choice:

Choice

If I use UPPER({!Plan} + '_PRODUCT_A') I get (OLD) STARTER_PRODUCT_A instead of STARTER_PRODUCT_A as I expected. I therefore seem to be getting the choice label when I use the {!Plan} placeholder instead of the choice value.

On the suggestion of the comment from User6670 below, I have tried the following:

UPPER(TEXT({!Plan}) + '_PRODUCT_A')

But this yields the following error when I save the flow:

The formula expression is invalid: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text

How do I write a formula so that I get STARTER_PRODUCT_A as the result?

Best Answer

For whatever reason, as noted here, you seem to get the label if you refer to the field, but you get the value if you pass the field into a record element/variable.

As @Mitesh stated, you should be able to store the Choice Value as a variable and get what you need.

  1. Create the variable. Click on Manager --> New Resource enter image description here
  2. Select Variable for Resource Type. Leave default as blank and select available for input and output
  3. After your screen component, you need to create assignment logic. enter image description here
  4. Now you can refer to the variable you created to display the value of the choice in your formula as UPPER({!Hold_Choice_Value} + '_PRODUCT_A')

enter image description here