What is the difference between ISNULL() and ISBLANK()?

As an admin, Formulas can be a little confusing sometimes.  Especially when there are two functions which appear to be very similar / do the same thing.

From the out set, the difference between these two functions can actually appear very slight.

But not all is as it appears, and sometimes the difference between them is actually what you want to test/validate… 

What is: ISNULL()

From a computing perspective  (which Salesforce adheres to), something could be NULL because it doesn’t exist or hasn’t been created/setup (in developer speak, you might say ‘instantiated’).

Ultimately, this means NULL is the absence of a value all together.

The ISNULL() function will return a TRUE or a FALSE value, which you can then use in validation rules, workflows, formulas, etc.

What does this mean in real world? 

In Salesforce, if you had a date field, with no value in it.  Salesforce would return TRUE.

However, if you had a text field ISNULL() would always return a false value, even if there was no text in the field.  This is because Salesforce stores an empty value in text, even if there is nothing in the field – which leads us to…

What is: ISEMPTY()

Like the above function, you get a boolean (TRUE/FALSE) output.

However ISEMPTY() goes a step further than ISNULL() and by adding support for text fields (like the example above).  

When is a field is ‘not empty’? 

If it contains a character, blank space, or a zero. (ie ISEMPTY() = FALSE)

And now text field which is contains no text, will now return ISEMPTY() = TRUE.  Along with other fields, like dates or numbers.

Still unsure?

Here is a developer meme that circulates around the forums, which highlights the difference between the two 🙂 

Both ISEMPTY() & ISNULL() are bad outcomes in this example!
Adam Gill

Hi, Adam here! I am a Trailhead Ranger and also 5x certified. I have been working with Salesforce since 2007, across a wide variety of CRM projects and orgs (both greenfield and legacy). I love travelling and fun fact, I had my scuba diving license before my driving license!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.