Blog

Handling Multi-Select Picklist Values Using Flows

Objective :

In this, we will handle Multi-Select Picklist Values Using Flows by splitting the selected values based on the semicolon and storing them in a collection of strings.

Use Case :

Here, we took an example of creating an account record by entering the Account Name,
Phone, City, and Capital using screen flow. Here the City is of type Multi picklist and the
Capital is of type picklist.

The flow allows creating account records only when the Capital value is not selected in the
City values.

Step 1 :

Create a Screen Flow, we have created a flow ‘Account Flow with Multi Select Picklist’.
Added the Screen to get the input of Name, Phone, City, and Capital values from the User.

Step 2 :

In the Assignment element, assigned the selected City multi-picklist value to the new
variable.

Flow setup for Multi-Select Picklist Values Using Flows

Created four formula variables

VariableFormula
SeparateString(LEFT({!SelectedCity},FIND(“;”,{!SelectedCity
})-1))
LastSeparateStringTRIM((RIGHT({!SelectedCity},LEN({!Select
edCity})-FIND(“;”,{!SelectedCity}))))
RemoveAddedStringTRIM(SUBSTITUTE({!stringToRemove},
{!SeparateString}, “”))
SplitStringTRIM(
SUBSTITUTE(
{!Select_City},
“;”,””) )

Step 3 :

Added Assignment element, in that, added the each selected multi-select picklist value to the
Collection of list.

Removed the added value from the selected City (i.e) string variable which contains selected
multi-select picklist values.

Salesforce Flow to handle Multi-Select Picklist Values

Step 4 :

Added a decision to add all selected values are added to the list and to stop the
recursive call when the last selected value is added.

Multi-Select Picklist Values Using Flows – entry conditions
How to map Multi-Select Picklist Values in Salesforce Flows

Step 5 :

Using the Collection filter element, get the selected capital value which is present in
the selected city multi-pick list value.

Using Flows to update Multi-Select Picklist fields

Step 6 :

Added the decision to check if the string collection which is returned from the
collection filter has value, it will not allow creating account record or else account record will
be created for the given values.

Loop through Multi-Select Picklist Values Using Flows
Record-triggered Flow for Multi-Select Picklist Values
Multi-Select Picklist Values Using Flows – decision element

The Final Flow will be

Salesforce automation for Multi-Select Picklist Values Using Flows

Output

For the selected Capital value that does not contain in selected City value.

Best practice for handling Multi-Select Picklist Values Using Flows
Multi-Select Picklist Values Using Flows in screen flow

For the selected Capital value that does not contain in selected City value

Assigning values in Multi-Select Picklist Using Flows
Complete example of Multi-Select Picklist Values Using Flows

We are Inno Valley Works, We are a passionate team of developers, best thinkers and consultants who can solve anything and everything.
With our highly engaging team, you can easily bring the vision to all your business ventures come true.
We have team, put your problem, get your solution


🎥 Check Out Our YouTube Channel

Explore helpful tutorials, product updates, and feature walkthroughs from the team at Innovalley Works.

👉 Visit Our Channel