There was a post in the Official: Salesforce Workflow Automation:
One of the field that user inputs on the screen is picklist in Salesforce. What is the best element to use for that. Do I need to create all picklist values as choices or is there any other way? Appreciate your help.
The short answer is, every picklist must be created in each Flow by a Dropdown List and Choices. There is a long answer (very long!), and it’s Custom Settings! Custom Settings were reviewed in Learning Flow 1.B. Find Related Records and Have Users Select Them in a Screen – Select a Contact and Price Book. The Custom Settings reviewed in that post were Hierarchy, the Custom Settings in this post will be List.
Start by going to Setup and search Custom Settings in the Setup Search Bar. Click on Custom Settings. For the Label, type Picklist Fields, and for the Object Name, type Picklist_Fields. Select List for the Setting Type, Visibility can be Public. For description, type, picklist fields for different objects based on Record Type.
Click Save. You should now see this.
You’ll start with the section that says, Custom Fields. Click New. Select the Data Type of Text, then click Next. Name the Field Label Object, length of 255, and the Field Name should be populated as Object as well. Click Next then Save & New. For the next New Custom Field, select the Data Type as Text, then click Next. Enter the Field Label as Field and the length as 255, Field Name should be Field, then click Next. Click Save & New. For the Data Type, select Text Area, type Record Types as the Field Label, the Field Name should show Record_Types. Click Next, then Save. You should see this.
Now click Manage. For this example, you are going to recreate the picklist field of Stage from Opportunity. You should see this page.
Click New. You’ll create the first one with visuals, after that, you’ll be set to continue entering them yourself. Start by typing the Name of the picklist value, since you’re doing the Stage picklist on Opportunity, start with the first picklist value, Prospecting. Then type in the Object field, Opportunity, then Field as (you can pick the API name or the Field Name itself, for this post, you’ll go with API Name) StageName, and enter all 18 digit Record Type Ids of the Record Types that contain Prospecting, separated by commas. In the development environment, there are no record types, so you can leave that blank in this environment.
Continue to create all the picklist field values that make up the Stage field on Opportunity. Your screen, at the end, should look like this.
Uh oh, everything is out of order! If you were to use a dynamic picklist field, you wouldn’t be able to sort by name for this field. So, go back to the main Custom Setting Picklist Fields page. In the Custom Fields section, click New. Then select Number as the Data Type. For the field label, type Order, you can leave the length at 18, then click Next, then Save. You should see Order as another field. Click Manage and then click Edit on each of the Picklist Fields to add an order to the field. Make sure to match the order in the Opportunity Stage Field! You will see an example of the first one below.
Make sure to do that for each field in the list, and then you’re ready to go to Flows!
For this post, since you’ll just need to see how to recreate the picklist field in the Flow, you won’t connect it to anything, so this is informational on how to build the picklist field in Flows using Custom Settings instead of actually connecting or doing anything with the Flow.
Create a New Flow. First, Create a new sObject Variable by clicking on Resource at the top and double clicking on sObject. Type in sovOpportunity for the Unique Name, and the Object Type as Opportunity and click Save. Since you aren’t connecting to anything or truly doing anything other than build a picklist, those variables don’t matter in this example too much, but make sure they are correct when you’re using this in your actual Flows!
Take the Screen from the Palette and drag it to the Canvas. Type the Name as Picklist Test, Don’t show Previous button, and uncheck Show Pause button. Click Add a Field, and drag over the Dropdown List. Click on the [Dropdown List]. For the Label and Unique Name, type Stage. Click the drop down arrow for Choice Select Resource and select Create New Dynamic Choice. For the Unique Name, type OpportunityStage. Value Data Type for this field is Text, so that is ok. This next part is important. For the object, select your custom object, Picklist_Fields__c. Yep, Custom Settings are essentially custom objects, but reside in memory, so they are easier to grab. For the Field, select Object__c, Operator equals, and for Value, type Opportunity. Click Add Row. F: Field__c O: equals V: StageName. If you were using Record Types, you would click Add Row, F: Record_Types__c O: contains V: sovOpportunity.RecordTypeId. This last piece will search the field, Record Types, where you entered all the Record Type 18 digit Ids that were allowed the picklist value. Since there isn’t a Record Type in development orgs set up from the beginning, you’ll skip this one for now if you are using a standard development org. For the Label and Value, select Name. Next, check Sort results by: and in this case, since you want to sort by Order instead of by Name, select Order__c and then Ascending. For the Field and Variable section at the bottom, you might want to assign the Opportunity the new Stage, so you might write Field: Name and Variable: sovOpportunity.StageName. In this case, since you’re not updating anything, you can delete the row by clicking on the trash can on the right hand side of the row. Your Dynamic Choice should look like the below image.
Click OK. You should see this.
Click OK. Set the Picklist Test Screen as the start element by clicking on the green circle with the white down arrow. The Save the Flow and name it Picklist Test. Click OK. Don’t worry about the general warning, you shouldn’t have the Screen connected to anything. Click Run. You should see this.
Congratulations! You just recreated the picklist field for Stage on Opportunity using Custom Settings so that you can easily add it to Flows! Make sure if you change the Stage field on the Opportunity object or any Record Type settings associated with the Stage field on the Opportunity object, you go update the Custom Setting Picklist Fields too!!! (Much better in one place once than many Flows!!!) Now you can use this with any picklist field on any object to help you build better Flows!