function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SilkcutzSilkcutz 

Referencing Choice Input Values

I have a question in flow that has two choices. I have 'Show Input on Selection' ticked. However, we have not been able to reference the value that is input.

 

Referencing the question gives me the Choice label. Referencing the Choice gives me the Choice label. None of them provide the value of the input field within the Choice.

 

The crazy thing is this did work! It just seems to have stopped and recreates do not get it working either. It is driving me nuts.
Any one experience similar or have any ideas?

 

Thanks in advance.

Best Answer chosen by Silkcutz
RajaramRajaram
So here is the "interesting" thing, when you refer to the screen choice field and use it on a display text field, you will get the label, but if you use the same screen choice field say in a record element or pass it to an apex plug-in, the engine will use the stored value.

So, you really do not need to create a variable and assign it to the variable, if you do not care about showing the value to the user in the UI.

Makes sense?

All Answers

LloydSilverLloydSilver

Not an answer but I posted this identical question immediately after you (we were typing at the same time. I agree that this used to work but does not seem to work any longer. Something weird is happening or SFDC changed this behavior. 

RajaramRajaram
Here is a test case I have and the expected scenario
Screen 1 has a Choice Field called "Choice_Input" which has 2 choices:
1. Choice_1 with Stored Value "V1" and no input on selection. The label is "Choice 1"
2. Choice_2 with input on selection set. The label is "Choice 2"

Screen 2 has a display text which shows the value of "Choice_Input"

When you run the flow screen 2 will ALWAYS show the label of the choice you selected. So, it will be "Choice 1" or "Choice 2".

However, if you assign "Choice_input" to a variable, you WILL see the variable set to "V1" is the user selects "Choice_1" or the input entered if the user selects "Choice_2".

Hope this helps..
Silkcutz01Silkcutz01
Thanks Rajaram. Through trial and error I was able to work this out for myself (i.e. you can only get the value by assigning the q to a variable). However, do you know why the previous approach was working for both Lloyd Silver and myself and then simply stopped? We are looking to expose some Flows through sites and cannot have function changes without advance warning.
RajaramRajaram
So here is the "interesting" thing, when you refer to the screen choice field and use it on a display text field, you will get the label, but if you use the same screen choice field say in a record element or pass it to an apex plug-in, the engine will use the stored value.

So, you really do not need to create a variable and assign it to the variable, if you do not care about showing the value to the user in the UI.

Makes sense?
This was selected as the best answer
Daniel A PlummerDaniel A Plummer
That's sfdc's MO - changing things all the time so that you built stops working. Usually they are good about alerting us, though. It seems that this was one such change.