While working as a Salesforce admin, I got a requirement from our client. Basically, they wanted to ensure that users enter the resolution details before closing a customer’s case.
Many users were directly changing the case status picklist to ‘closed’ without adding a resolution. To solve this, I used the ISPICKVAL() function in a validation rule.
The validation checks if the status picklist value is “closed” and the resolution field is blank. If both conditions are true, Salesforce displays an error message and prevents the record from being saved.
In this article, we will learn how to use the ISPICKVAL() function in Salesforce. In addition, we will discuss the syntax and business use examples of this function.
ISPICKVAL() Function in Salesforce
The Salesforce ISPICKVAL() function is used to determine whether the value selected in a picklist field is equal to a specified text literal.
The syntax of the ISPICKVAL() Function in Salesforce is as given below:
ISPICKVAL(picklist_field, text_literal)Here is a detailed explanation of the parameters of the function:
- picklist_field: This picklist_field parameter specifies the merge field name of the picklist, or you can say that it is the API name of the picklist field that you want to check.
- text_literal: This text_literal parameter specifies the picklist value that you want to match in the quotes. Or, in simple words, you can say that it is the text value that you want to check with the picklist field value.
This Salesforce ISPICKVAL function returns a Boolean value (True or False). If the selected value of the picklist field matches the passed text_literal, the function returns True. Otherwise, the function returns False.
In addition to this, there are some considerations that we must take care of while working with the Salesforce ISPICKVAL() function:
- Text Literal Text Type: The text_literal parameter of the ISPICKVAL function must be of the text type in Salesforce.
- Enclosed in Quotes: To show that a parameter is of the text type, it is important always to include the text_literal parameter in quotation marks.
- Text Literal Limitation: Recall that the text_literal argument of the Salesforce ISPICKVAL Function cannot be a merging field or the function’s resultant value.
- Replacement of picklist_field: In the Salesforce ISPICKVAL function, replace the picklist_field argument with a custom or standard field of type picklist.
- PRIORVALUE Function with ISPICKVAL Function: If you want to check whether the previous value of a picklist field includes a specific value, you can use the PRIORVALUE function. It is useful when you want to track the changes in the picklist field value.
- Syntax: INCLUDES(PRIORVALUE(picklist_field), text_literal)
- CASE Function with ISPICKVAL Function: To determine if a picklist value is equal to a particular value or not, you can use the CASE function of Salesforce.
Let’s see an example better to understand the concept of the ISPICKVAL Function of Salesforce:
Suppose you want to track the status of the job application. You have a picklist field that lets you set the job application status to “Submitted”, “Review”, “Interview Scheduled”, or “Rejected”.
And based on the interviewer’s job selection, the interviewee receives the status message. Below is the formula for that scenario using the ISPICKVAL function of Salesforce:
Here:
- Picklist field name = Application_Status__c
- Formula field name = Interview_Response__c
IF(
ISPICKVAL(Application_Status__c, "Submitted"),
"Application is submitted.",
IF(
ISPICKVAL(Application_Status__c, "Review"),
"Application is under review.",
IF(
ISPICKVAL(Application_Status__c, "Interview Scheduled"),
"Interview has been scheduled.",
IF(
ISPICKVAL(Application_Status__c, "Rejected"),
"Your application has been rejected.",
"Status not specified"
)
)
)
)
With this, we have learned about the Salesforce ISPICKVAL Function, including its syntax, considerations, and an example. Next, we will try to figure out the difference between the Salesforce ISPICKVAL function and the INCLUDES function.
Difference: ISPICKVAL() & INCLUDES() Functions in Salesforce
Let’s differentiate the “ISPICKVAL()” and “INCLUDES()” functions in Salesforce in tabular format.
| Basics | ISPICKVAL() Function | INCLUDES() Function |
|---|---|---|
| Purpose | The Salesforce ISPICKVAL function checks whether a picklist field value matches a specified value. | The Salesforce INCLUDES function checks whether a multi-select picklist field contains a value. |
| Syntax | The syntax of the ISPICKVAL function: ISPICKVAL(picklist_field, text_literal) | The syntax of the INCLUDES function: INCLUDES(multi_picklist_field, text_literal) |
| Return Value | If the picklist value matches the text_literal, the function returns “True”; otherwise, it returns “False”. | If the multi-select picklist value is included in the text_literal, the function returns the boolean value “True”, else “False”. |
| Usage | The ISPICKVAL function determines whether a specific option is selected. | The use case for the INCLUDES function is to check whether a record belongs to one or more categories. |
| Field Type Compatibility | Picklist fields | Multi-select picklist fields |
| Example | Calculate the number of attendees for an event based on the selected venue capacity. | Grouping the accounts based on the multiple cities where they are located. |
With this, we have understood the difference between the ISPICKVAL() and INCLUDES() functions in Salesforce. Now, we will move on to learn how to use the ISPICKVAL function in Salesforce.
Use the ISPICKVAL() Function in Salesforce
Below are the steps that help us to understand how to use the ISPICKVAL function in Salesforce.
- Click the “Gear Icon” in the top right corner of the page. Click “Setup“ from the dropdown menu to continue.

- The setup page opens when you select the Setup option. Here, the “Object Manager” is found in the Navigation Bar next to the Home Page. Click on it.

- The object manager page opens when you click it. There are numerous objects seen here. Use the Quick Find search field to locate the item we want to use the ISPICKVAL() function on.
- Here, I have selected the Product object.

- On the product object page, the “Field & Relationship” option is in the details section on the left. Select “Field & Relationship” from the menu.
- The field and relationships page is opened after selecting the field and relationship option. Click the “New” button at the top of the page.

- The field type page opens when you click the new button. The page contains a wide variety of field types. In this case, I chose the “Formula” field type, as I want to use the ISPICKVAL() function in the advanced formula.
- Click the “Next” button to move on to the next step.

- After clicking the next button, you will be taken to the “Choose Output Type” step. Here, you need to enter the “Field Label” and “Field Name” and then select the “Formula Return Type”.
- In this example, I set “Product Stock” as the field label, and when I click the field name box, the information is automatically filled in. Then, since I want the output in text format, I click the radio option next to the text and select “Text” as the formula return type.
- After that, click on the “Next” button and proceed to the next step.

- In a step, you will be taken to the “Enter Formula” page. Select the advanced formula subtab, and enter your formula here to use the extra fields and functions.
- Navigate to the “Functions” section on the right side of the page, where you need to click on the “All Function Categories” dropdown menu.
Then, create a formula that, based on the picklist option selection, compares the selected product’s availability to the value you provided in the text_literal parameter and displays the product’s stock status.
Below is the formula according to the above-defined example:
IF(ISPICKVAL(Product_Availability__c, "Out of Stock"), "Unavailable", "Available")- Here, we use the IF function to check whether the value of the picklist field “Product_Availability__c” equals “Out of Stock” using the ISPICKVAL function in Salesforce.
- If the picklist field value matches the specified passed value, the product stock status is returned as “Unavailable”.
- If the picklist field value does not match the specified passed value “Out of the Stock”, the product stock status is returned as “Available”.
- To move to the next step, click the “Next” button.

In this step, establish “Field-Level Security“. Choose the profiles to which we wish to grant field-level security edit access to this field. If field-level security is not added, the field will be hidden from all profiles.
As I want it to be visible to all profiles, I have checked the “Visible” checkbox. After that, click the “Next” button located at the top.

- Add the custom field to the “Page Layout“ after setting up the field-level security. Pick the page layout that has this field in it. If we do not select a layout, the field will not appear on any pages.
- To save the formula field, click the “Save” button.

Once the formula field is created, you can use it. Let’s see an example:
- Open the Products Item, create a new product with the picklist field “Product Availability”, and save the product.
- Once you save it, go to the details of this product, and you will see that the field “Product Stock” shows the result of the ISPICKVAL function.
Suppose you create a product with the “Product Availability” picklist value set to “In Stock”. The formula starts executing, matches the selected value against the passed text_literal value, and returns the result.
In my case, I passed the text_literal value as “Out of Stock”, so it will not match with the text_literal value, and it will return the result as “Available” in the field “Product Stock”.

As a result, we have learned how to use the ISPICKVAL function in Salesforce.
Conclusion
In conclusion, we have learned the syntax and actual business-related examples for the Salesforce ISPICKVAL function. Moreover, we know that to determine if any value selected in a picklist field equals a text literal, we use the Salesforce ISPICKVAL function.
Furthermore, we have learned the procedure of using the Salesforce ISPICKVAL function in both Salesforce Lightning and Salesforce Classic.
You may like to read:
- INCLUDES() Function in Salesforce
- IMAGE() Function in Salesforce
- Salesforce ISNEW Function
- Salesforce PRIORVALUE Function
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.