+ Start a Discussion
atlantisatlantis 

How to get picklist value in formula, if there are mass picklist option

Just want to get the selected value of a picklist in formula,

 

and I know the CASE() or ISPICKVAL() should be used.

 

But it is terrible if there are mass of option in picklist.

 

I hate to do it like this.

 

 

Anyone can help me?

 

Thanks,

Atlantis

Best Answer chosen by Admin (Salesforce Developers) 
Manoj_79Manoj_79

To get The Selected Value from Picklist you can try TEXT(Picklist Field Name). It will return the Selected Picklist Value.

 

Thanks

 

Manoj

All Answers

atlantisatlantis

Also, if do it with CASE().

 

formula allows maximum 3,900 characters, but my formula has more the 14,000 characters,

 

Any idea?

 

Thanks

 

 

Manoj_79Manoj_79

To get The Selected Value from Picklist you can try TEXT(Picklist Field Name). It will return the Selected Picklist Value.

 

Thanks

 

Manoj

This was selected as the best answer
atlantisatlantis

thanks,Manoj_79

 

It works.  I really appreciated it.

 

Best regards,

 

Atlantis

 

 

Systems IntegrationSystems Integration

How do you substitute the text from a picklist? If a single quote in a picklist value is breaking your javascript, it needs to be replaced, but this doesn't even let you save the javascript for a button.

 

var someVar = '{!SUBSTITUTE(TEXT(MyRecord.MyPicklist), "'", "\'")}';

 

// Error: Incorrect parameter for TEXT. Expected Number, Date, DateTime, received Picklist

JSchneiderJSchneider

It might be that there have been updates since this solution.  But in order to use a picklist value in a formula I had to convert to TEXT then NUMBER.  ex.

 

Opp_Ad_Mag_Percent__c     Values (25,50,75,100)

 

So to get the amount of money to be credited to Ad/Mag I had a custom formula field:

 

Amount * VALUE(TEXT(Opp_Ad_Mag_Percent__c))/100

 

Derek Bennett 5Derek Bennett 5
Thanks @Manoj_79, this helped me alot.
Bridget SullivanBridget Sullivan
How does Manoj_79's answer work? When i try TEXT(field_name__c), I get this error: "Error: Incorrect parameter type for TEXT. Expected Number, Date, DateTime, received Picklist"
Kerith KahealaniKerith Kahealani
I get the same "Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text" when I try TEXT(field_name__c), what's the secret?  
Simon Purnell 2Simon Purnell 2
V. Important: You cannot use TEXT() on multi-select picklists. Multi-select picklists are not recommended in formula fields.