In this Salesforce tutorial, we will learn to use the ISBLANK function in Salesforce CRM. We will discuss the use case of the ISBLANK function with the help of a validation rule. This function is executable in Salesforce Lightning and Classic editions.
What is ISBLANK function in Salesforce
In Salesforce, the ISBLANK function is a formula function used to check if a specified field or expression is empty or null. It returns a Boolean value (true or false) based on whether the specified field or expression contains data.
It can be used in the fields, reports, workflow rules, and validation rules. While using this function in a validation rule an error message will trigger if the field is left blank.
This function is particularly useful for data validation and conditional logic within the Salesforce platform.
Syntax of the ISBLANK function
In Salesforce ISBLANK function is executed with the help of the syntax below.
ISBLANK(expression)
In the above syntax, the expression is supposed to be replaced by a field, field reference, formula, or any valid expression. The function evaluates whether the specified expression is blank or null. If the expression is blank or null, the function returns TRUE otherwise, it returns false.
Considerations:
There are a few considerations that we should be aware of while using the ISBLANK function in Salesforce.
- If you want to check the null values then use the ISNULL function instead of the ISBLANK function because The ISBLANK function returns True for both null values and empty strings.
- The ISBLANK function is often used in validation rules to ensure that certain fields are not left empty when records are created or updated.
How to use ISBLANK function in Salesforce Lightning
In the below steps, I will explain the execution of the ISBLANK function in Salesforce Lightning with the help of a Validation in Salesforce object.
1. Navigate to the Setup page of Salesforce Lighting, and for that click on the settings icon that is on the upper right of the screen.
2. On the Setup page of Lightning click on the Object Manager tab.
3. In the Object Manager, select an object to set a validation rule using the ISBLANK function. In this example, I have selected the object Account.
4. In the setup window, click on Validation Rules in the left sidebar and then click on the New button.

5. In this step, we will define the validation rule with the help of the ISBLANK function.
- Enter a relevant name for the validation rule in the Rule Name field. In this example, I have named the validation rule as Account Validation.
- Go to the Functions scroll bar and select the function ISBLANK then click on the button Insert Selected Function.

6. After inserting the ISBLANK function in the formula editor we need to replace the expression in the function with a field. To select a field click on the button Insert Field.