How to get multi-select picklist values in formula field?



Requirement Overview

Hi everyone, in this post we will talk about how we can fetch multi-select picklist(selected) values in any formula field. To get the selected value from picklist you can try TEXT(Picklist Field Name) and It will return the selected picklist value which makes slight easier to play with it however when it comes to multi-select picklist, we need to put more effort to accomplish our task.

One important point is to considered that we can not directly use TEXT function to convert multi select values into text . You can refer here for more information.

Demo

We can use INCLUDES in our formula to get the expected result and its recommended by Salesforce. You can play with the below code snippet and update it according to you need.
Basically here we are checking , if the values are available in multi-select picklist field then we are concatenating the values separated by a delimiter(;).

Code Snippet

IF ( INCLUDES ( multipicklist__c , “Value 1” ), “Value 1; “,null ) &
IF ( INCLUDES ( multipicklist__c , “Value 2” ), “Value 2; “,null ) &
IF ( INCLUDES ( multipicklist__c , “Value 3” ), “Value 3; “,null ) &
IF ( INCLUDES ( multipicklist__c , “Value 4” ), “Value 4; “,null ) &
IF ( INCLUDES ( multipicklist__c , “Value 5” ), “Value 5; “,null )

This example would produce return values such as:

Value 1; Value 2; Value 3; Value 4; Value 5;
Value 1; Value 4; Value 5;
Value 2; Value 5;
Value 4;

Conclusion

Now we can see that it’s possible to show the contents of a multi-picklist field using the formula shown in this resolution. There is currently an Idea as well requesting to make this a standard functionality with the help of the existing TEXT() function: Support TEXT () function to convert “Multi-select picklist” to “Text” 

I hope you find this post useful! Catch you in the next content.
And thank you for being an awesome reader.
Share and grow together !!

If you have any doubts you can comment down below, I will try to reply ASAP.

Also keep visiting us, for more such content!

Adil Ansari

Md.Adil is a Senior Salesforce developer, a Computer Science graduate working on the Salesforce platform and providing customer solutions using force.com as a Salesforce consultant/developer. He is the founder of SalesforceBitsandBytes blogging site. He shares unique real time posts on different Salesforce implementations, the source code available on this SalesforceBitsandBytes blog is fully tested in the development environment.

Leave a Reply

Your email address will not be published. Required fields are marked *