Using Custom Screen Components with Conditional Field Visibility to Create Dependent Picklist Combos

This scenario is common and powerful: you have a Flow Lightning Screen Component on the screen. Perhaps its an out-of-the-box component like Address or Lookup, or maybe it’s a custom component like QuickChoice. You want to have another component on that screen use conditional visibility and make the visibility dependent on the value of the selection in your first screen component.

This works really well, but there are a couple of little tricks that it helps to know about. The main thing to know is that outputs from Lightning Screen Components are only immediately available to the Conditional Field Visibility subsystem if you use the recently introduced Automatic Output Handling by clicking off the “Manually assigned Variables (Advanced)” checkbox.

This is necessary because the checkbox activates the older manual variable system, which doesn’t get updated with changed values until the Next/Finish button is clicked. When the checkbox is off, the new Automatic Output Handling is turned on, and conditional field visibility will work.

Here’s a video demo:

When you turn off this checkbox, (which is on by default in Spring ’20 for new components, but will be off by default starting in Summer ’20), you still won’t see the component show up in Set Component Visibility until you close and reopen the screen. At that point, you’ll be able to select the value from the parent screen component as an input into the visibility expression:

Theoretically, it should be possible to chain together a huge number of these….!

Subscribe
Notify of
guest
6 Comments
Inline Feedbacks
View all comments
Jake Bullard

This is super helpful! I ran into the exact issue and concluded that it wasn’t possible but it didn’t occur to me to check to use the auto tool! Thank you!

Clifford

Hi Alex, ever noticed that under “Set Component Visibility” the custom condition logic: NOT 1 does not work in Flow? I think this is a bug…

I want to display a textfield under the condition, that a text collection does NOT contain a user selected value of a picklist.

Rick Z

Hi Alex! huge fan met you last year @dreamforce. Quick question, I’m using component visibility to hide previously answered text field questions in a form in a single screen (it’s a longish form & we don’t want multiple pages etc.) However, the hidden component’s values are missing when I try to create or update records. Is this expected behavior? is there a work around? I’m probably not using it as intended but It’s a game changer and I’d love to be able to do that. Thank you!

sean

Hello! Thanks for the post here… running into an issue where I would like to do essentially the same thing but my Picklist is filled with a dynamic “Record Choice Set”. Which is a set of Tasks subjects that can only be preformed if a Lead is in a certain status. So essentially my Picklist shows what kind of actions can be taken next. One of those actions I would like an additional field to open up. I can get this to work on the next screen depending on the choice, but would prefer if the option appeared on the… Read more »

sean

hmmm just realized this is an actual custom component… would this work in my scenario then?