(Note: This blog posts only covers how you configure a dependent picklist for use in a screen flow and how to reference the picklist values selected by the user, and not all the steps to complete the flow.)
With Winter ’20, Salesforce introduced a standard dependent picklist component for use in a screen flow. Now, depending on what the user selects from a picklist (controlling), we can show picklist items dependent on that first selection in a screen flow.
Business Use Case: Addison Dogster is the system administrator at Universal Containers. Addison received a requirement to show a dependent picklist in a screen flow, just like on the Swag record. When a user selects a value from the Status picklist, the Open for Offers field is populated with only the picklist items for a given status.
Solution: Addison recalled reading about the Dependent Picklist feature in Flow Builder in the Winter ’20 Release Notes and is excited for the opportunity to give it a whirl.
Quick Steps:
Pre-requisites:
- Create a custom picklist field (Status).
- Create a custom picklist field (Open for Offers) and set Status as its controlling picklist.
1. Let’s create the flow. In Setup, for Classic, go to Create | Workflows & Approvals | Flows. In Lightning Experience, it is found under Process Automation | Flows.
A. Draw the Screen flow element to the canvas.
B. Drag the Dependent Picklist standard component to the screen area and configure it accordingly.
- API Name: DependentPicklist
- Object API Name: Swag__c
- Picklist 1 API Name: Status__c (This is the controlling picklist’s API name)
- Picklist 2 API Name: Open_for_Offers__c (This is the dependent picklist’s API name)
Note: When you need to reference the dependent picklist selection by the users in your flow, you will find it here…
Let’s say we are creating a new record and setting the status__c and open_for_offers__c fields using the values selected by the user.
You’d want to pay close attention here since the name of the reference fields is not what you would expect. I would be looking for something called “Picklist 1 Value” or “Picklist 2 Value,” not “topValue” and “middleValue,” respectively.
- Status__c: {!DependentPicklist.topValue} [Note: topValue is the picklist 1 value]
- Open_for_Offers__c: {!DependentPicklist.middleValue} [Note: middleValue is the picklist 2 value.]
That’s how to configure the dependent picklist on a screen flow and how you reference the picklist user selections.
That’s all folks.
Deployment Notes/Tips:
- The flow, custom object and custom fields can be deployed to Production in a change set (or can be deployed using a tool such as Metazao’s Snapshot).
- Don’t forget to update the custom field’s FLS and object access for the profiles that will use the flow.
- You will find the flow in a change set under the Flow Definition component type.
- Activate the flow post deployment as they deploy inactive in Production, unless with Winter ’19, you have opted in on the Process Automation Settings screen, to “Deploy processes and flows as active.” NOTE: With this change, in order to successfully deploy a process or flow, your org’s Apex tests must launch at least 75% of the total number of active processes and active autolaunched flows in your org.
Can you please recommend for Custom settings in Salesforce
LikeLike
I’m not sure I understand the comment.
LikeLike
This is really helpful, thank you!
A reminder to all: API names of objects and fields are Case Sensitive! I built this, missed a capital letter on my Object__c (not object__c) – no end of frustration, totally self-inflicted.
Any idea how to set a default value on the primary picklist?
LikeLike
I don’t believe you can set a default, unfortunately. I tried.
LikeLike
Thank you so much for the tips! It’s amazing how little info there is on this component – or at least there’s not a lot of easy to follow info! I am running into a roadblock though – I got it to work on one flow but on another flow it’s not populating any values at all. I made sure the Custom Object and Picklist 1 & 2 (w/ the correct case sensitivity) were set on the component and the field dependecy was added on the object, the flow is also saved and the most recent version activated. However when I run the debug no picklist values show. My profile also has full access to the object/fields. Any ideas?
Also, in my org we have TONS of Cat / Subcategories w/ a multiple of record types using them. Is there an easier way to deal w/ record type specific picklist values?
LikeLike
The OOTB feature does not take into account picklist values by record type. I’d suggest maybe looking into the record type picklist lightning component from the UnofficialSF.com (https://unofficialsf.com/record-type-picklist/). We built our own custom lightning component to do the same in our org.
LikeLike
Thank you, thank you!! You have saved me hours of time trying to figure it out on my own–who knows how many hours.
LikeLike
I’m happy to be of help!
LikeLike
Thank you so much! It is very clear!
I have a quick question. Does the dependent picklist support Multi-Select Picklist? I added my Multi-Select Picklist as the dependent picklist, but it only allows me to select one option in the screen flow.
LikeLike
Hi Jen, Great Article! I have a flow question about dependent picklists. In my org we have picklist A that holds a list of acronyms of our programs and is the controlling field to picklist B. Picklist B holds a list of the full names of our programs. Each value in picklist A has a 1-1 connection with a value in picklist B. I have a flow where I am trying to update the values of picklist A and Picklist B. I am being passed in the value for picklist A to the flow so I can insert that directly into Picklist A. Is there a way in the flow for me to be able to lookup the dependent value from picklist B based on the value i’m passed in for picklist A if they are a 1-1 ratio? I know I could probably do this using a formula field and a case statement but there are about 110 values in those picklists which could make for a pretty big case statement! That and the fact these change all the time would make using a case statement a maintenance disaster! Thanks in advance for any help you can provide!
LikeLike
Unfortunately, I do not believe there is a way to have it select the single dependent picklist value in flow.
LikeLike
Hi Jenwlee, thanks for the great article! Is there a way to make the picklists required or will they always be optional as in the case with picklists in general within SF fow?
LikeLike
There is no ability to make the picklist flow component required but in the dependent picklist component, you can specify a picklist to be required. It is one of the configurable attributes.
LikeLike