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
Salesforce 283Salesforce 283 

How to use CONTAINS in picklist field using formulas?

Hi Guys,

I want to write a validation in one object. I will have to write on picklist(ISPICKVAL) but i need to implement contains function in picklist field and how to write that. Please provide me some examples.

Thanks,
Mahesh.
Best Answer chosen by Salesforce 283
Amit Chaudhary 8Amit Chaudhary 8
You can try like below
CONTAINS(Text( FieldName__C ),"ReadUP")
Tips for Working with Picklist and Multi-Select Picklist Formula Fields

Please check below post.
https://help.salesforce.com/apex/HTViewHelpDoc?id=tips_for_using_picklist_formula_fields.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=tips_for_using_picklist_formula_fields.htm&language=en_US)

Please let us know if this will help you

Thanks
Amit Chaudhary

All Answers

Jithin Krishnan 2Jithin Krishnan 2
Hi,
You can check like this:
CONTAINS( TEXT(picklist__c ), texttocheck)

where texttocheck is the string you want to check in the picklist value. Please let me know if you have any doubts.
Thanks!
Amit Chaudhary 8Amit Chaudhary 8
You can try like below
CONTAINS(Text( FieldName__C ),"ReadUP")
Tips for Working with Picklist and Multi-Select Picklist Formula Fields

Please check below post.
https://help.salesforce.com/apex/HTViewHelpDoc?id=tips_for_using_picklist_formula_fields.htm&language=en_US (https://help.salesforce.com/apex/HTViewHelpDoc?id=tips_for_using_picklist_formula_fields.htm&language=en_US)

Please let us know if this will help you

Thanks
Amit Chaudhary
This was selected as the best answer
Salesforce 283Salesforce 283
Hi Amit, It's working. Thanks a lot.
guestadmin Tomguestadmin Tom
Hi Amit,
For deep understanding and real-time use cases of ISPICKVAL, INCLUDES, AND CONTAINS, you can refer here (http://salesforcebitsandbytes.com/when-to-use-ispickval-includes-and-contains-in-the-salesforce/)