Salesforce Flow – How to Default An Existing or the Current Picklist Value
Have you ever wanted to use a dropdown list within a Salesforce Flow Interview Screen and have it dynamically populate with the current value of that picklist field? Well I’m here to show you how!
First, make sure you store the current value of the picklist field in a variable within a Lookup step in your flow. Here, I’m storing/assigning the current Delivery/Installation Status value to a variable.
Then, on the desired screen where you would like to present this information, add a “Dropdown List” field.
Now, you will want to give your users a choice between all of the available values of that picklist field. Hint: using this method to add a choice future-proofs your flow so that even when available picklist values are changed your flow won’t need to be updated! Within the choice settings section, select “Picklist Choice.”
Now you will choose the Object & Field where you would like to pull the available choices from. Notice the spelling mistake “Piclist Choice Settings” – c’mon Salesforce!
Now let’s quickly recap what we’ve accomplished so far. We’ve taken the current value of a picklist field and stored it within a Flow Variable. We’ve also added a Dropdown List field to an Interview Screen and populated it so that our user can choose from all of the available picklist values from the same field. If we stopped here, we would be storing the current value in a variable, but the Dropdown List on the Interview Screen wouldn’t automatically default to the current value. The user could choose from any available value for that field but would not have any way of knowing what the current value on the record is. See, I can’t set the Default Value!
The key to selecting a default value is to create another choice, this time just a standard “Choice.”
Now this is where it gets fun. Instead of typing a static Label for this default choice, we are going to use the variable we stored so that it will always dynamically display the text of the current value. We also want the variable’s value to be the “Stored” value of this selection so that if we update the record from this Screen Choice Field the correct information will be passed.
Now we are able to set the Default Value of our Dropdown List to this new default choice.
Here it is in action! We have an Opportunity that has a current Delivery/Installation Status value of “In progress.” If we interact with this Opportunity via our Flow, we would expect to see this value already populated.
Sure enough, “In progress” is the selected value within our Dropdown List field!
One important note: this method will actually create two choices that are exactly the same. We created a choice that contains the full list of all available values for this picklist field, and then we also have the default/current value. As you can see below, you see “In progress” twice. It doesn’t matter which one you select, this field would pass the same value!
Stay tuned as our Salesforce Flow Series continues with more tips & tricks!