Formula: Concatenate multi-select picklist values in Formula field without the trailing ‘;’

Hola! 😀

I recently came across a use case where the customer wanted to display the concatenated values of Multi-select picklist in a formula field. The tricky part of the request was that customer didn’t want the leading ‘;’ in the result of formula field.

Let’s say if we had to write this formula for a Multi-select picklist field with a values A, B, C and D then the formula would look something like this.

SUBSTITUTE(
    IF ( INCLUDES ( MultiPicklist__c , "A" ), "A; ", null ) &
    IF ( INCLUDES ( MultiPicklist__c , "B" ), "B; ", null ) &
    IF ( INCLUDES ( MultiPicklist__c , "C" ), "C; ", null ) &
    IF ( INCLUDES ( MultiPicklist__c , "D" ), "D; ", null ) + '-',
    "; -",
    null
)

The solution is fairly simple but it took me a while to figure this one out, so I thought it might be worth sharing with my fellow admins. 😀

Hope you find this one useful! Catch you in the next one! ✌️
And thank you for being an awesome reader! Subscribe to this blog for receiving all the latest updates straight to your inbox. 🙂

Advertisement

One thought on “Formula: Concatenate multi-select picklist values in Formula field without the trailing ‘;’

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.