function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
akeymakeym 

Formula to check if a picklist contains a specific word.

We have a bunch of values in our picklist that start with the word "Outbound".
 
We will also be doing imports later that will have this word also.
 
So how would I use a formula to find a picklist value that contains the word Outbound?
akeymakeym

I thought I could do something like this:

CASE ( Find("Outbound",  LeadSource), 1, "Target", 0, "Lead")

However, it still give me this error:

Error: Field LeadSource is a picklist field. Use it with an ISPICKVAL() or CASE() function instead.

I think I'll find a different workaround.
NordbergNordberg
CASE ( Find("Outbound",  LeadSource), 1, "Target", 0, "Lead") -

If I understand you correctly you need to reference the LeadSource field using the case function.

Case(LeadSource,"Outbound",1,0) in this case, if the LeadSource value was "Outbound" the field value would produce 1 if not it would produce 0.  I have not seen nor have i tired to utilize the contains function in conjuction with a picklist.

I hope that helps.
JakesterJakester
Nordberg, that is probably close to what akeym will need to do, although it's not what he was hoping to do.

akeym, welcome to one of the worst things about Salesforce.

Basically, picklists are crippled in a shockingly stupid way, and that means that you'll need to add a case statement for every single choice. You cannot read picklists as strings.

Yep, it sucks. Please vote for the idea to fix this, although at this point I'm skeptical it will ever be listened to.
akeymakeym
Well, I sort of figured it out.  I used a workflow instead.  The only issue with a workflow is that each record is only updated when it's modified or created, whereas a formula updates all records.
jisaacjisaac
Jakester,
I would vote for the idea - can you tell us where to find it amid the slew of ideas out there?

Thanks,
JakesterJakester

The blue text in my original post that said "worst things about Salesforce" was a hyperlink directly to the idea. Here it is again:

http://ideas.salesforce.com/article/show/43022/The_ability_to_use_a_picklist_value_in_a_formula_field_without_ISPICKVAL

miteshsuramiteshsura

how about INCLUDES function???

eg.: INCLUDES(Hobbies__c, "Golf") returns TRUE if one of the selected values in the Hobbies custom multi-select picklist field is Golf.

Justin AllenJustin Allen
Anyone else landing on this page - just do:

CONTAINS(TEXT(picklist__c),"Outbound")