Maximizing Radio Picklists in Salesforce Flows: Default Values

Salesforce’s Flow tool is a powerful way to aid data-entry from your users. Specifically, “Screen Flows” allows you to build custom forms for any type of user and embraces Salesforce’s notion of clicks-not-code. With the Flows user interface, you can specify complex branching logic to show different screens in different scenarios.

Most standard Flow components allow you to initialize any given component with values that have been pre-filled for the user. For example, this streamlines the user experience by having common values pre-selected or by populating values directly from an existing record. It is possible for users to overwrite critical data with a null or different value when a default value is not used.      

The “Radio Picklist” component – an integral piece of most screen flows – lacks the capability of gracefully accepting a default value. We’ll cover standard functionality, some basic workarounds, and how to use an Unmanaged Package called QuickChoiceFSC to accomplish this task.

For the example case in this post, we’ll be using a very simple flow architecture, shown below.

Salesforce’s Flow Architecture

Standard Radio Picklists

First, let’s cover the standard functionality. The Standard Radio component takes one or more Picklist Choice Sets (PCS) and/or Choices as input. The PCS takes values straight from the object; it grabs all of the values available for that field and displays a radio button for each. If you change the values available on the field, they will automatically and immediately match in the Flow.

Let’s use the “Incident Type” field on the Case object.

Incident Type

If you want to be more granular – or perhaps ask a question that does not pertain to a field on a record – you can instead use the “Choices” datatype. You must create a new Choice variable for each choice you would like to display in the radio picklist. In our example, we will define a Choice variable to equal the currently saved value on the Case record.

Choice variable

One limitation with Standard Radio Picklists is that you can only pick a Choice variable as your Default value and that the Choice variable must also be displayed in the Radio Picklist component. In the standard component, you can display a Picklist Choice Set but you will not be able to display a default choice.

The second option is to create a Choice variable for each option in your picklist. This allows you to show the currently saved value from the record (or choose any value as the default value) but this is less maintainable because you have to manually add/delete Choices to match the field on the object.

You can combine these two methods, and the best out-of-the-box functionality you can get for default values looks like this:

The Choice variable is selected as the Default Value in both screenshots. This Choice will always show up on the bottom of the list, below the values for the Picklist Choice Set.

Pros:

  • Quick and easy way to accomplish default values
  • No code
  • Picklist Choice Sets are low maintenance and come from the Case object definition
  • Selected value comes from the Case record

Cons:

  • The blank value selected when the field is null
  • The duplicate value selected when the field is not null
  • There is no way to make this field required since a null value is technically considered a valid choice by the component

If this functionality is acceptable to your use case, then you’re done here. However, I would argue that as a professional Salesforce admin with attention to detail, I think we could do something better. 

Custom Radio Flow Screen Component

For this reason, we turn to an Unmanaged Package called quickChoiceFSC

You can install the Unmanaged package or have a developer install it from the source.

In the screenshots below, you can compare the Standard components (top two components) with the QuickChoice components. We have two scenarios: Null value and existing value.

Custom Radio Flow Screen Component image 1Custom Radio Flow Screen Component image 2

As you can see, the QuickChoice component is able to successfully retrieve the values from the record directly. There are no duplicate values or blank values in the available choices.

Summary

Whether you are using Flow components out-of-the-box or looking for the advanced capabilities in the unmanaged package, every organization should be looking at leveraging Flows to streamline complex user-interactions. 

About Us

SpringML is an advanced analytics services firm leading data-driven digital transformation journeys. We are a Salesforce Silver Partner with a sizable Einstein Analytics Champions team, providing end-to-end advanced analytics, data and workflow integration services with Tableau and Mulesoft. We unlock the power of data to transform your business one use case at a time. Start your journey with us. For more information feel free to contact us at [email protected].