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
Bryan Leaman 6Bryan Leaman 6 

Formula to show picklist text (not value!) on a related object

I leveraged the new-ish feature of picklists that lets me have a value that is displayed and a code that is stored in the object record and they're different.   However, now I'd like to show the picklist value (not the code) on a related object, but the only thing I can find is to do TEXT(object__r.picklistfield__c), which always returns the code, not the value.

For example, if my picklist (Customer_class__c) had values defined as:
Value                              API Name
Enterprise Customer      CC1
Business Customer        CC2

Then from a related record, a formula TEXT(Account.Customer_class__c) will show "CC1" and I want to show "Enterprise Customer".

Any ideas?  So far all I've come up with is to put a case statement in the formula:
CASE(TEXT(Account.Customer_class__c),
'CC1', 'Enterprise Customer',
'CC2', 'Business Customer',
... etc...
'Unrecognized code')
Best Answer chosen by Bryan Leaman 6
AnkaiahAnkaiah (Salesforce Developers) 
Hi Bryan,

Right now, it is not possible.

Please upvote the below idea. Once we got the sufficient votes then it will be implemented in the future releases.

https://ideas.salesforce.com/s/idea/a0B8W00000GdpRbUAJ/allow-picklist-value-labels-in-formulas

If this information helps, Please mark it as best answer for future rferences.

Thanks!!

 

All Answers

AnkaiahAnkaiah (Salesforce Developers) 
Bryan,

I have tried with below formula, its working for me.
CASE(TEXT( Account.Customer_class__c ),
"CC1", "Enterprise Customer",
"CC2", "Business Customer",
"Error"
)

Refere the below screenshot for your reference.

User-added image

If this helps, Please mark it as best answer.

Thanks!!
Bryan Leaman 6Bryan Leaman 6
Thanks, Ankaiah. That's all I could come up with too, as noted in my original question.
I'm looking for a way to do it without having to replicate my picklist values in the formula field. 
 
AnkaiahAnkaiah (Salesforce Developers) 
Hi Bryan,

Right now, it is not possible.

Please upvote the below idea. Once we got the sufficient votes then it will be implemented in the future releases.

https://ideas.salesforce.com/s/idea/a0B8W00000GdpRbUAJ/allow-picklist-value-labels-in-formulas

If this information helps, Please mark it as best answer for future rferences.

Thanks!!

 
This was selected as the best answer