Build a flow to make dependent picklist editable

Solution Description:

Based on one picklist’s selected value, another will be displayed. The dependent picklist screen component displays each picklist value by using the field dependency we created between two picklists.

  • Use the standard object or custom object.
  • Create two picklist fields in the object (Standard/Custom).
  • Make field dependency between the two picklists.
  • Flow Creation and use those picklists in flow using the Dependent Picklist component.

Custom Object or Standard Object and Picklist fields:

  1. Create the custom Object called Position.
  2. Create two picklist fields.
    • Type__c: Full Time, Part Time
    • Functional_Area__c: IT Developer, IT Tester, Finance, Marketing

Field dependency between two picklists

A field dependency connects two picklist fields on the same object.

  • Setup -> Object Manager -> Position Object.
  • Fields & Relationships -> Click the Field Dependencies button.
  • New -> Controlling field(Type) ->Dependent field(Functional Area)
  • Select the cells on dependent fields for the respective controlling fields. Use the Include or Exclude button to add or remove the cell values.
  • Click SAVE.
Expected Output for dependent picklists

Flow Creation

  • Setup-> flows -> New Flow(dp_example1).
  • Screen Flow -> Add Element Screen(Label: Screen_1).
  • Drag and Drop the Dependent Picklist component into the screen.
  • Provide values for the dependent picklist component as per the below table shows: 
API Namedp_Component
Object API NamePosition__c
Picklist 1 API NameType__c
Picklist 2 API NameFunctional_Area__c
  • 5. Set Component visibility as Always.
  • Create two variables called Type and Functional Area to store the selected picklist values.
  • In Advanced ->Select the Manually Assign Values checkbox and provide values as per the table.
Picklist 1 Value{!dp_Type}
Picklist 2 Value{!dp_functional_area}
Screen_1 Output Format (Based on the Type field value, Functional area field will be displayed.)
Screen1_Output2
  • Display the picklist values on another screen using the Display Text Component.
Screen2_Output Format

References

https://help.salesforce.com/s/articleView?id=sf.flow_ref_elements_screencmp_dependentpicklists.htm&type=5

Leave A Comment

All fields marked with an asterisk (*) are required