Activity › Forums › Salesforce® Discussions › Difference between ISBLANK and ISNULL in Salesforce
Tagged: Help & Training, ISBLANK, ISNULL, Salesforce Development
-
Difference between ISBLANK and ISNULL in Salesforce
Posted by Kumar on December 22, 2016 at 1:50 PMHi everyone,
What is the difference between ISBLANK() and ISNULL() function? In what scenario should we use one over the another?
Thanks
Parul replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hi kumar,
ISBLANK has the same functionality as ISNULL, but also supports text fields.
Text fields are never null, so using ISNULL() with a text field always returns false. For example, the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in the New field. For text fields, use the ISBLANK function instead.
- [adinserter block='9']
-
Hi,
Use ISBLANK instead of ISNULL in new formulas. ISBLANK has the same functionality as ISNULL, but also supports text fields. Salesforce will continue to support ISNULL, so you do not need to change any existing formulas.
A field is not empty if it contains a character, blank space, or zero. For example, a field that contains a space inserted with the spacebar is not empty.
Use the BLANKVALUE function to return a specified string if the field does not have a value; use the ISBLANKfunction if you only want to check if the field has a value.
If you use this function with a numeric field, the function only returns TRUE if the field has no value and is not.Thanks
-
HI
Adding some points more:
It is preferred to use the ISBLANK Salesforce function instead of ISNULL Salesforce function in new Formulas. ISBLANK() has the same functionality as ISNULL(), but also supports text fields. Salesforce will continue to support ISNULL, so you do not need to change any existing formulas.
ISNULL():
Text fields are never null, so using ISNULL() with a text field always returns false. Empty date and date/time fields always return true when referenced in ISNULL() functions.
ISBLANK():
If you use ISBLANK() with a numeric field, the function only returns TRUE if the field has no value and is not configured to treat blank fields as zeroes.
For example, the formula field IF(ISNULL(new__c) 1, 0) is always zero regardless of the value in the New field. For text fields, use the ISBLANK Salesforce function instead.
Thanks
Log In to reply.