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
gksgks 

Dynamic Choice not writing to Variable

I have a variable (record ID) that is populated by the URL on starting a flow, followed by a lookup step to pull in 3 other fields from that record based on the ID and store the values for those fields in 3 variables.  That is working fine.

 

Later in the flow, there is a dynamic choice where a user can select a different record to work on, and the dynamic choice then populates those same 3 variables.

 

When the user goes to the next screen, which displays the values for the variables, they are shown the values for the original record (which was passed in the URL), not for the one selected in the dynamic choice.

 

Is it something to do w/ a variable being input only or output only?  I have tried input only and input / output.  

 

Any ideas?  Seems like a dynamic choice should be able to update these variables.

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
RajaramRajaram
You can set a screen input field to a default value as you are already doing. However, the current design is such that the default value is just set once when you reach the screen. If you go back or loop forward into the same screen again, the input will always show the previous value used - kinda like the browser form behavior. This is why in my updated version you will see a difference in the display text value of the variable and the screen input field.
We do have the enhancement to change thie behavior in the roadmap.

However, I believe there is a workaround for this, but putting the screen in a subflow. I would search for other posts in this board. If I find, i will update this as well.

Hope this helps.

All Answers

RajaramRajaram
Gorav, This should not happen. The best way would be to log a case. Please post the case number here when you do that.
gksgks

Thanks Rajaram

 

Have logged a case and attached screenshots of the flow, the dynamic choice, and the following screen element.

 

The case number is: 09280527.

 

Regards

Gorav

RajaramRajaram
Gorav,
I looked at your flow and it behaving as correctly .
Your dynamic choice just has a filter of stage__c equals Open. which will always result in April, August, May.
It is not related to the initial lookup at all.
So, if you run the flow from the designer, your first screen will be the "Booked Panel Information" screen with the above 3 as choices. I have a new version of the flow which will show how your variable values for start date and end date give you the correct data.

I will update the case we well.
gksgks
Thanks Rajaram,

In your version, the correct values are indeed displayed in the display
text area, when you go from the booked panel info screen to the display
panel info screen.

However, is there a way for the values from the dynamic choice to populate
and update the default values for start date and end date as I had tried to
configure it previously? This is important in this case because I have an
input validation rule that prevents the user from changing the month of the
panel, so the default value must be set when the screen loads.

In my version, where the variables were set to be the default value for the
Start Date and End Date fields, the Start Date and End Date fields would
not update based on the dynamic choice selected.

For example, if you select April and hit next, it takes you to the display
panel info screen, and shows the April values. If you hit previous (which
takes you back to the dynamic choice), and select May or August and hit
next, then it takes you to the display panel screen but it still shows you
the April values (as the default value for the field)

I think my question would be better stated as: If a field has its default
value set to a variable, and the variable is updated by a dynamic choice,
should the default value of the field display the correct value based on
the dynamic choice selected?

Thanks again,
Gorav
RajaramRajaram
You can set a screen input field to a default value as you are already doing. However, the current design is such that the default value is just set once when you reach the screen. If you go back or loop forward into the same screen again, the input will always show the previous value used - kinda like the browser form behavior. This is why in my updated version you will see a difference in the display text value of the variable and the screen input field.
We do have the enhancement to change thie behavior in the roadmap.

However, I believe there is a workaround for this, but putting the screen in a subflow. I would search for other posts in this board. If I find, i will update this as well.

Hope this helps.
This was selected as the best answer
gksgks

Thanks again, all makes sense now.  Will pursue the subflow option, and look forward to the roadmap.  Great product!

gksgks

I tried putting the screen element into a subflow and experiencing the same "caching" issue.

 

Will simplify my flow and remove the functionality as it will work well enough without it.

 

Thanks for the help - if you come across other posts w/ more info on the subflow please send, but its not urgent, it will work pretty well as-is.

 

Regards

RajaramRajaram
Do you think this may help?
Not exactly the same, but may be worth a shot.
http://boards.developerforce.com/t5/Visual-Workflow/Flow-Clear-Input-Values/m-p/600091/highlight/true#M1247