Parse a Multi-Select Value in Visual Flow [Unmanaged Package included]

In my post on using a Flow inside another Flow, I mentioned wanting to create a Flow that could be re-used for the problem of needing to parse a Multi-Select value.  So, here it is!

Unmanaged Package:

https://login.salesforce.com/packaging/installPackage.apexp?p0=04ti0000000YDzU

Let’s talk about what is in this Unmanaged Package, so that you understand what you’re installing into your Org.  I want you to be able to easily reference this Flow for any use cases you might have.  So, that is why it is listed as Unmanaged and why I’ll have this detailed blog post on what is going on.

Flow Overview

parse-flow-image

ParseFlow.jpg

 

Let’s talk about what each of these Elements are doing.

Remove Brackets

The Remove Brackets Element is cleaning up the input String that we have.

Remove Brackets Formula.jpg

The Formula (sorry, it doesn’t want to stay formatted for me):

TRIM(
SUBSTITUTE(
SUBSTITUTE(
{!input_MultiSelectString},
“[“,””),
“]”,””),
) + “;”

Note: I am cleaning up the original Input variable.  After I clean the variable, I am assigning that new value (my Text Formula above) to the new Text Variable called Multi_Select_Value.

removebrackets

Add Left Value

What we want to do now, is grab the Left value in our String and add it into a Collection Variable.  This will be what you can Loop through to perform login on.

Grab Left Value Formula.jpg

The Formula:

(LEFT({!Multi_Select_Value},FIND(“;”,{!Multi_Select_Value})-1))

grableft

Remove Last Parsed Value

Now that we’ve successfully added the first value into our Collection, we want to remove that value and its semicolon from the String.  This will allow us to then see if we have remaining values or not in our next element.

removelastparsedvalue

The Formula:

(RIGHT({!Multi_Select_Value},LEN({!Multi_Select_Value})-FIND(“;”,{!Multi_Select_Value})))

removeparsed

Remaining Values to be Parsed?

All we’re doing here is checking to see if the value of Multi_Select_Value is null or not.  If it is null, then we want to exit the Flow and send out our Output.  If it is not null, we want to continue along and keep parsing until we have a null value.

decisionofparse