automation

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

Posted by SFDCr

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!

Related Post

17 thoughts on “Go With The Salesforce Flow – How to Default the Current Picklist Value

  1. Jordan

    Great info thank you! Does this apply to lightning? Also how can I see the other 16 comments?

  2. Bob

    Hi,

    This post is great and it works, but when i have a null value in the record field, the flow inserts the choice name I have for a default value ( InterfaceConnector_ch) instead of None. Is there any way to stop this from happening?

  3. Jeff S.

    Great guide, With the new Flow Builder, I have a record choice set that functions similarly to have Dynamic Record Choices worked. By default a Record choice set’s options are set to False. I was wondering if you know of a way I can set them to True by default?

  4. Joachim Rahlf

    Really good advice, something you need to get shown, not very intuitive from the Salesforce UI. I tested that in the new Flow Builder – works perfect. THX für sharing !!

    1. SFDCr

      Awesome! I am so glad it has helped you!

  5. Steven Goldreich

    This is great. If you could update this to reflect the Flow Builder changes, that would be helpful.

  6. Vincent

    This is great!
    Was looking for this, thank you!

  7. Karen Zelevinsky

    Thanks – this really helped me out!

    1. SFDCr

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

  8. Default Flow Picklist Value Without Duplicates

    […] Salesforce Flow – How to Default An Existing or the Current Picklist Value […]

  9. Default Flow Picklist Value Without Duplicates | Metillium

    […] Salesforce Flow – How to Default An Existing or the Current Picklist Value […]

  10. Nawshine

    Hi,

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

    Many Thanks

  11. Aviv Caspi

    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

    1. SFDCr

      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!

      1. Luke Freeland

        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/

        1. SFDCr

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

  12. Go With The Salesforce Flow - A Salesforce Visual Flow Series - SFDCr

    […] How to default an existing picklist value within a flow (to its current value). […]