Want to Parse and Loop on the Multi-Select Picklist Values in a Flow?
Parsing the Multi-Select Picklist Selected values in a Flow is required where we need to use Selected Multi-Select Picklist values later inside the Flow for Loop and various use cases. Like using Multi-Select Picklist values as a Collection variable to Loop on them.
To Loop over Multi-Select Picklist values in a Flow, we need to Assign the Multi-Select Picklist Values to a Collection Variable. Because we can only Loop using Collection variables in a Flow.
Don't forget to check out: Flow Builder in Salesforce | The Ultimate Developer Guide
Why do we need to Parse Multi-Select Picklist Values in Flow?
Well, we need it because whenever we use a Multi-Select Field on a Flow Screen or query a Multi-select field value of any record using a Get Element, the format of the Multi-Select values is like this [A;B;C;D] which are semi-colon separated and not comma-separated. This kind of a variable is not considered as a Flow Collection Variable and cannot be used as a Flow Loop Variable. We somehow need to convert the Format of these values to [A,B,C,D] similar to a text collection variable so that it can be used in Loops to Loop on Multi Select Values in a Flow.
There are many solutions that I found on Google and community forums for a workaround of this problem.
But they all require either a Big Formula or a lot of Flow Elements and overall the Flow becomes quite complex.
Check out an amazing Salesforce video tutorial here: Before Delete Trigger in Salesforce Flows - Winter '21 update
The best part is that you just need to download an Apex Action to use this Feature.
Download the Un-Managed Package from the Links Below:
To see the detailed steps and examples, you can check out this
article on Accidental Coder.
Hope this helps!