In this Salesforce Tutorial, 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.
While working in a multinational company as a Salesforce Developer, I got a task to assign the leads to the sales representative based on the selected region picklist value.
So, as a solution, I found that there is Salesforce Function named “ISPICKVAL()” which you can use to assign the lead based on their region picklist value.
If you want to learn how to use the ISPICKVAL function in Salesforce Lightning and Salesforce Classic, deep dive into the complete article and learn the concept of the ISPICKVAL function working with multiple examples.
ISPICKVAL() Function in Salesforce
Salesforce ISPICKVAL() function is one of the TEXT functions in Salesforce which is used to perform text operations in Salesforce fields. The Salesforce ISPICKVAL() function is used when we need to determine if the value selected in a picklist field is equal to a text literal you specify or not.
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 i.e. True or False. If the selected value of the picklist field matches with the passed text_literal, the function returns the result in True. Otherwise, the function will return the result as 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 to always 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 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 to better 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 allows you to set the status of the job application such as “Submitted”, “Review”, “Interview Scheduled” and “Rejected”.
And according to the selected status of the job by the interview, the interviewee gets 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 the Salesforce ISPICKVAL Function with the syntax, some considerations, and an example. Next, we will try to figure out the difference between the Salesforce ISPICKVAL function and the INCLUDES function.
Difference between ISPICKVAL and INCLUDES functions in Salesforce
Let’s differentiate the “ISPICKVAL” and “INCLUDES” functions in Salesforce in tabular format.
Basics | ISPICKVAL Salesforce Function | INCLUDES Salesforce Function |
---|---|---|
Purpose | The Salesforce ISPICKVAL function is used when we need to check if a picklist field value has a specified value or not. | The Salesforce INCLUDES function is used when we need to check if a multi-select picklist field includes a value or not. |
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 with the text_literal, the function returns the boolean value “True”, else “False”. | If the multi-select picklist value is included in the text_literal, the function returns the boolean value “True”, else “False”. |
Usage | The use case of the ISPICKVAL function is that it is used to determine if a specific option is selected. | The use case of the INCLUDES function is that it is used to check if a record belongs to some catergories. |
Field Type Compatibility | Picklist fields | Multi-select picklist fields |
Example | Calculate the number of attendees for an event based on the venue capacity selected. | Grouping the accounts based on the multiple cities where it is located. |
With this, we have understood the difference between the ISPICKVAL function and the INCLUDES function. Now, we will move ahead and learn to use the ISPICKVAL function of Salesforce in both Salesforce Lightning and Salesforce Classic.
Read LEFT Function in Salesforce
How to use the ISPICKVAL() Function in Salesforce Lightning
Below are the steps that help us to understand how to use the ISPICKVAL function in Salesforce Lightning.
Step 1: Login into your Salesforce account in the Lightning Experience. If your account is not logged in to the main home page of the Salesforce Lightning setup. Click on the “Gear” icon at the right side of the top page and then from the dropdown click on the “Setup” option.

Step 2: After that, click on the “Object Manager” option next to the home tab in the navigation bar.

Now, you will see the list of all the objects of Salesforce both standard and custom. Search for the object in which you want to use the Salesforce ISPICKVAL function in the “Quick Find” search box and click on it.
Let’s use the “Product” object as an example since I want to show the status of the product based on the picklist value whether the product is in stock or not.

Step 3: After you click on the next, you will be taken to the product page where you may access all the functionalities-based settings for the product object. Your requirement is to create a new custom field where the ISPICKVAL function can be used, for this select the “Field & Relationship” option from the list on the left and then click the “New” button.

Step 4: In this step, you will be taken to the “Choose the Field Type” step. Choose the appropriate “Data Type” to reflect the type of information the custom field is going to contain.
Because we are going to utilize the ISPICKVAL function, tick the radio button next to the “Formula” field type to choose it. Then, to go to the following step, click the “Next” button.

Step 5: 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 entered “Product Stock” as the field label, and when I click the field name box, the information is filled in automatically. Then, as I want the output in text format, I click the radio option next to the text and select “Text” as the formula return type field.
To move to the next step, click on the “Next” button.

Step 6: In step, you will be taken to the “Enter Formula” page. Select the advance formula subtab, and enter your formula here, to use the extra fields and functions. Navigate to the “Functions” sections on the right side of the page, where you need to click on the “All Function Categories” dropdown menu.
Once you click, a dropdown will appear with a number of function categories, select “Text” from the list as you are aware that Salesforce’s ISPICKVAL function is a form of the text function category. You will see a list of all the text functions after clicking on the text. Next, scroll down, look for the “ISPICKVAL” function, and then click it.
Click on the “Insert Selected Function” button that will appear under the functions section box once you have clicked on the function. The function has now been added to the advance formula box, replace the parameters of the function with the appropriate text, fields, etc.
Scenario: Imagine you were given the duty of displaying a product stock status based on its availability. For this, you require a picklist field that the product manager can use to control product availability.
Then, create a formula that, corresponding with the picklist option’s selection, that compares the availability of the selected product to the value you gave in the text_literal parameter and displays the product 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 that checks if the value of the picklist field “Product_Availability__c” is equal to the value “Out of Stock” using the ISPICKVAL function of 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”.
Step 7: Now, to make sure the formula shown above is correct, click the “Check Syntax” button. You will see the message “No syntax error in merge fields or function” if the formula is error-free. You will, however, receive an error message if there is one.
You can optionally include the “Description”, “Help Text”, and “Handle the empty fields” if you want. Then, to move to the next step, click on the “Next” button.

Step 8: In this step, you must set field-level security. You need to select the profile here to which you want to grant field-level security editing rights for the custom formula field created above.
In this example, I select the “Visible” checkbox and then click the “Next” button to go to the next step.

Step 9: In this step, you are taken to the “Add to page layouts” page. Pick the page layout that has this field in it. Also, take note that this field will be inserted as the last one in the column section of the layout of this page. Moreover, no pages will have the field if you don’t choose a layout.
In order to save this created custom formula field with the ISPICKVAL function, click the “Save” button.

Once the formula field is created, you can use this formula field. 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, move to the details of this product, and you will see it shows the field “Product Stock” according to the result of the ISPICKVAL function.
Let’s understand with a scenario:
Suppose, you create a product with the picklist “Product Availability” value selected as “In Stock”. The formula starts executing and matches the selected value with 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_liternal value, so it will return the result as “Available” in the field “Product Stock”.

With this, we have learned how to use the ISPICKVAL function in Salesforce Lightning and now we will move ahead and learn to use the ISPICKVAL function in Salesforce Classic with an example.
How to use the ISPICKVAL() Function in Salesforce Classic
Below are the steps that help us to understand how to use the ISPICKVAL function in Salesforce Classic.
Step 1: Login to the Salesforce account in Salesforce Classic Experience. If your account opens in the Lightning Experience by default, click “Profile” and then click the “Switch to Salesforce Classic” option from the dropdown menu.

Step 2: After successfully logging in to Salesforce Classic, click “Setup” from the top menu, which is located between your name and the help option.

Step 3: In this step, you will be taken to the main setup page for the classic experience. Click on the “Customize” dropdown after scrolling down to the “Build” section on the left side of the page. You will now see a list of all standard and custom Salesforce Classic objects. Select the Salesforce object on which you want to use the ISPICKVAL function.
Example: I want to calculate the contract end date based on the contract validity period picklist field value, thus I use the “Contracts” object as an example.
Now, click on the “Contracts” object, then select the “Fields” option from the drop-down menu.

Step 4: In this step, the contract page, which contains all the custom and standard fields, is opened. To add a new custom field, scroll down to “Contracts Custom Fields & Relationships” and click the “New” button.

Step 5: You must choose the “Data Type” in this “Choose the Field Type” step in order to define the type of data that the custom field will hold.
Since using the ISPICKVAL function is your main objective and it will be used in the formula type, check the radio button next to the “Formula” field type to pick it. After that click on the “Next” button and move to the next step.

Step 6: As soon as you click the next button, you will move to the “Choose Outype Type” step. Enter the “Field Label” and “Field Name” and then choose the “Formula Return Type”.
In the example: I typed “Contract Due Date” into the field label, and when I clicked on the field name box, that value was automatically filled in. I then go down and tick the radio box next to the date to specify “Date” as the formula return type.
To proceed to the following step, click the “Next” button after that.

Step 7: In this step, you will reach the page “Enter Formula”. Navigate to the “Functions” section on the right side of the page, and then select the “All Function Categories” dropdown menu. Now, select “Text” as you are aware that the ISPICKVAL function is a type of text function.
When you click on the text, a list of all the text-related functions appears; look for the “ISPICKVAL” function and click on it. Once you have clicked on the function, a button labeled “Insert Selected Function” will appear below the functions section box.
Now that the function has been added to the advance formula box, substituted the function parameters with the required text, fields, etc.
Scenario: Assume you are the HR Manager for the organization and you have been given the duty of determining the contract’s end date based on the contract validation period.
And the contract validation period field is a picklist-type field with the two options “1 Year” and “2 Year”. In order to complete this task, you need to create a formula that determines the due date based on the chosen picklist value validation contract period.
To build the formula, you can utilize the ISPICKVAL function from Salesforce. The function determines whether the value of the selected picklist field matches the provided text literal parameter and returns the result accordingly.
Below is the formula according to the above-defined scenario:
IF(ISPICKVAL(Validation_Period__c, "1 Year"), StartDate + 365, StartDate + 730)
- Here, we use the IF function that checks if the value of the picklist field “Valiadtion_Period__c” is equal to the value “1 Year” using the ISPICKVAL function of Salesforce.
- If the picklist field value matches the specified passed value “1 Year” the formula calculates a new date by adding 365 days to the value of the “StartDate” and returns the “Contracts Due Date” after one year from the start date.
- If the picklist field value does not match the specified passed value “1 Year” the formula calculates a new date by adding 730 days to the value of the “StartDate” and returns the “Contracts Due Date” after two years from the start date.
Step 8: Click the “Check Syntax” button after entering the formula in the advanced formula to make sure it is written correctly. You will see the message “No Syntax errors in merge fields or function” if the formula is error-free. You will see an error message otherwise.
You can also, define the “Description”, “Help Text“, and “Handle the empty field” if you want. Click the “Next” button after that.

Step 9: You will be taken to the “Establish Field-Level Security” page. Here, you must choose the profiles to which you wish to grant editing access to the field in order to modify field-level security. If you haven’t chosen a profile, this particular field will be hidden from all of the profiles.
In this example: I have selected the “Visible” checkbox because I want every person on the profiles to have the ability to change this field information. After that, click on the “Next” button to move to the next step.

Step 10: You must choose the page layout for the newly created custom formula field in this “Add to Page Layout” step. The formula field will then be saved after you click the “Save” button.

Once the formula field is created, you can use this formula field. Let’s see an example:
- Open the Contracts Item, create a new contract with the picklist field “Validation Period” value, and save the contract.
- Once you save it, move to the details of the contract, and you will see it shows the field “Contract Due Date” according to the result of the ISPICKVAL function.
Let’s understand with a scenario:
- Suppose, you create a contract with the picklist “Validation Period” value selected as “1 Year”. The formula starts executing and matches the selected value with the passed text_literal value and returns the result.
- In my case, I passed the text_literal value as “1 Year”, so it will match with the text_literal value, so it will return the result as “Start_Date__c + 365” in the field “Contract Due Date”.

With this, we have learned how to use the ISPICKVAL function in Salesforce Classic.
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 you specify 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:
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.