[SalesForce] Process Builder – Using Not Null & Is Changed

I'm running into issues using Process Builder to solve for the following business scenario: Marketing wants to automatically create a Task when a Lead is updated and an association is made to a Campaign via custom field called "Most Recent Campaign". They don't want a Task created if the lead is new, only when it's edited. Also, the Subject of the Task should be based on the Campaign Type of the Most Recent Campaign association.

The PB that I built works in all "positive" scenarios (when it's edited and not new, when Most Recent Campaign was previously null and now it's populated, and when Most Recent Campaign is changed to another value), except when a value was previously populated in Most Recent Campaign and it is updated to be null.

PB Criteria
Most Recent Campaign Criteria

Create Follow Up Task
Follow Up Task

Subject Logic

IF(
    ISPICKVAL([Lead].New_Campaign__c.Type, "White Paper/Case Study"),
    "Note: White Paper/Case Study download",
    IF(
         ISPICKVAL([Lead].New_Campaign__c.Type, "Trade show"),
         "Note: Trade show registration",
         IF(
             ISPICKVAL([Lead].New_Campaign__c.Type, "Contact Us/Request a Demo"), 
             "Follow up: Contact Us/Request a Demo submission",
             IF(
                 ISPICKVAL([Lead].New_Campaign__c.Type, "Webinar"),
                 "Note: Webinar registration",
                 IF(
                     ISPICKVAL([Lead].New_Campaign__c.Type, "Event/Seminar"),
                     "Note: Event/Seminar registration",
                     IF(
                         ISPICKVAL([Lead].New_Campaign__c.Type, "Business Developement/Partner"),
                         "Follow up: Business Development/Partner form submission", 
                         ""
                     )
                 )
             )
         )
     )
)

The error I get in the Flow email is "The flow failed to access the value for myVariable_current.New_Campaign__c.Type because it hasn't been set or assigned."

I don't understand why the flow is getting to the action because it should't satisfy the criteria (i.e. Most Recent Campaign is null), which means nothing should happen (stopped/abandoned PB). Can someone shed some light on this?

Best Answer

Salesforce has deprecated the ISNULL() formula function. I can't find an exact date on it, but it was deprecated at least 6 years ago.

Instead, try using ISBLANK(). It can be used everywhere that ISNULL() is used.

Process Builder is...quirky (to put it charitably), so this may be enough to get things working as you expect. There is also some precedent for switching to ISBLANK() being the solution (look at Gail Flowers' comment on 2016-10-6, the bottom one at time of writing)

Related Topic