Ask Search:
Gage StaruchGage Staruch 

How can I auto populate a field based on values in a multi select picklist?

Okay, so here is our scenario.

We currently have 5 main industry types. When a lead is entered, users are required to select one (or more) of the values provided. (5 total)

When one of these industries is selected, salesforce will then add the corresponding "code" to the lead which is then picked up by Zapier (our integration conduit) and uploads them into our 3rd part email marketing software which assigns them to the appropriate email campaign based on the code it was assigned.

My dillema arises when a user selects multiple values from the picklist. (If an industry is more than one) The field that is populated with the "code" becomes blank. 

We will be fine tuning and adding to these industries in the future. Any suggestions or more effective methods?

Thanks
Best Answer chosen by Gage Staruch
Gage StaruchGage Staruch
Hmm, interesting.

What exactly will this formula do?
Would I need to customize mine to look more like this and just add as we need it?
F(ISBLANK( Account__r.Multi_Picklist_1__c ), NULL, 
SUBSTITUTE( 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + ".", "; .", NULL))

Also, the Account__r.Multi_Picklist_1__c becomes the custom name of the picklist right?

All Answers

Micah PerryMicah Perry
Consider other options than the multi-select picklist, such as checkboxes or a related record. A related record is very appealling if you plan on adding more values. This puts that power into your users' hands, instead of having them reach out to you every time they want to add an industry type. 

I don't know your formula that determines what "code" each industry type gets, or how it's handled when the lead is assigned multiple types, but you could have a code field on your related record, that the user needs to fill in if they add an industry type. Then, through Process Builder, you can have the code be assigned automatically from the related record.

Multi-select picklists (https://cloud4good.com/announcements/evils-multi-select-picklists-salesforce/) should really be avoided at all costs if possible.
Steve MolisSteve Molis
How is the field currently being updated?  Are you using a Formula?  If you are, can you post that Formula?
Gage StaruchGage Staruch
User-added image

@Steve Molis Here is our current process builder setup for this automation. The user would choose one of the options on the picklist and its given a code like "WDISTRO" which is what Zapier recognizes. Would a formula be a better alternative?
 
Steve MolisSteve Molis
Multi-Select Picklist fields are good at 3 things: 

1. Allowing a User to select one or more things from a list of options.
2. SUCKING 
I forget the third one... 

You could try creating Formula(Text) field and use a Formula kinda like this
IF(ISBLANK( Account__r.Multi_Picklist_1__c ), NULL, 
SUBSTITUTE( 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Multi"), "Multi; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Picklist"), "Picklist; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Fields"), "Fields; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Suck"), "Suck; ", NULL) + ".", "; .", NULL))


 
Gage StaruchGage Staruch
Hmm, interesting.

What exactly will this formula do?
Would I need to customize mine to look more like this and just add as we need it?
F(ISBLANK( Account__r.Multi_Picklist_1__c ), NULL, 
SUBSTITUTE( 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + 
IF(INCLUDES(Account__r.Multi_Picklist_1__c, "Industry Type 1"), "Industry type 2; ", NULL) + ".", "; .", NULL))

Also, the Account__r.Multi_Picklist_1__c becomes the custom name of the picklist right?
This was selected as the best answer
Steve MolisSteve Molis
The Formula is returning a concatnated Text String based of the values selected in the Picklist field  

You'd replace Account__r.Multi_Picklist_1__c with the API Field Name of your Industry Types field
 
Gage StaruchGage Staruch
Okay cool. That makes sense. 

So if I had 2 industry types. Say for example. Manufacturing and Transportation. Normally, it would return and populate MANUFACTURING for manufacturing and TRANSPORTATION for transportation. 

In this instance, it would return MANUFACTURINGTRANSPORTATION? or MANUFACTURING TRANSPORTATION (with the space?)

Sorry! I am pretty new to creating and implementing formulas
Steve MolisSteve Molis
That formula would return 
MANUFACTURING; TRANSPORTATION but with a few tweaks you could make it return MANUFACTURING TRANSPORTATION or MANUFACTURINGTRANSPORTATION
Gage StaruchGage Staruch
If it returns Manufacturing; Transportation, that would actually work great! 

I appreciate the assist, Steve!