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
Saloni MathurSaloni Mathur 

There is one picklist field which contain three text values: One, Two & Three and based on this value 1 or 2 or 3 will be populated in a text field. If the mapping is available in custom settings then how we can retrieve the value in text field ?

StephenDicksonStephenDickson
Hi Saloni,

You could create a formula field (Text) and in that formula field, you will need to use the function: TEXT() to extract the text from the picklist value.  For example, if your picklist was called 'My Field' and the current value selected is '1', then TEXT(My_Field__c) would return '1' as text.

You may also be interested in looking at the documentation for the function ISPICKVAL() which is helpful for checking the value of a picklist against a string.

Let me know if this helps you and close your query by marking it as solved so that it can help others in the future. It will help keep the forum clean.
Saloni MathurSaloni Mathur
Thanks Stephen for your reply. But my question is different. I have a custom setting with mapping (one : 1, two :2, three :3)
so based on the picklist value(one,two, three) selected I need to show value (1,2,3) in the text field using custom setting
StephenDicksonStephenDickson
I see, thank you for clarifying.  Some further questions:
  1. Are the picklist field and the text field on the same object? 
  2. Based on your requirements, can your text field be a formula field or are you working with a non-formula text field?
  3. Please clarify what you mean by "mapping" and "custom setting".
Thanks!