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
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?  
Kevin GutiKevin Guti
V. Important: You cannot use TEXT() on multi-select picklists. Multi-select picklists are not recommended in formula fields.
Stephanie Flouris 6Stephanie Flouris 6
Hi I have used this Formula, however, its only brining the first Picklist Value 
Adam ChimenAdam Chimen
@Manoj_79 answer helped me. Thanks.