Logo

Go With The Salesforce Flow – How to Default the Current Picklist Value

Salesforce Flow Series

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.

Salesforce Flow Record Lookup

Then, on the desired screen where you would like to present this information, add a “Dropdown List” field.

Salesforce Flow Add Dropdown List

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.”

Salesforce Flow Add 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!

Salesforce Flow Add Picklist Choice

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!

Salesforce Flow No Default Option

The key to selecting a default value is to create another choice, this time just a standard “Choice.”

Salesforce Flow Create Default 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.

Salesforce Flow Create Default Choice

Now we are able to set the Default Value of our Dropdown List to this new default choice.

Salesforce Flow Screen Picklist Field

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.

Salesforce Opportunity

Sure enough, “In progress” is the selected value within our Dropdown List field!

Salesforce Flow Defaults to Existing Value

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!

Salesforce Picklist Duplicated

 

Stay tuned as our Salesforce Flow Series continues with more tips & tricks!

10 comments for “Go With The Salesforce Flow – How to Default the Current Picklist Value

  1. Aviv Caspi
    December 11, 2016 at 2:48 am

    Hi,
    This blog post is very helpful, I followed the instructions and it actually works! Thanks much for sharing.

    I have a question – when there isn’t a value in the field the option we created appears as Null in the list.
    Is there a smart way to not show that option when the value at the field is Null?

    Thanks mcuh

    • December 18, 2016 at 8:54 pm

      Hey Aviv – Unfortunately I don’t know of a smart way unless you create a decision element and evaluate whether the actual field is null or not and then display two different screens depending, (one with the new option and one without). Happy flowing!

      • October 25, 2017 at 9:55 pm

        Thanks for helping me get started with this. You can use a “formula” to either display the current value or a “blank” value as the default choice instead of using the decision element. Also, you can use the PicklistValueInfo standard object with the dynamic record choice to get the picklist values and exclude the current value to eliminate the “duplicate” value.

        For more information, checkout my solution at http://metillium.com/2017/10/default-flow-picklist-value-without-duplicates/

        • October 26, 2017 at 5:19 pm

          You’re welcome! Awesome, great work and thanks for sharing!

  2. Nawshine
    August 24, 2017 at 5:21 am

    Hi,

    Thanks for this great post. Have you been able to do the same for radio buttons?

    Many Thanks

  3. Karen Zelevinsky
    August 8, 2018 at 3:45 pm

    Thanks – this really helped me out!

    • August 8, 2018 at 3:48 pm

      You are welcome Karen. Glad it could come in handy!

Leave a Reply

Your email address will not be published. Required fields are marked *