Activity Forums Salesforce® Discussions Difference between ISBLANK and ISNULL in Salesforce

  • Vikas Kumar

    Member
    January 9, 2017 at 11:32 am

    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.

  • shariq

    Member
    September 19, 2018 at 1:23 pm

    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

  • Parul

    Member
    September 19, 2018 at 5:22 pm

    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.

Popular Salesforce Blogs

Popular Salesforce Videos