Skip to main content
Improved formatting of Task Subject formula
Source Link
Derek F
  • 64.1k
  • 15
  • 54
  • 104
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", 
                         ""
                     )
                 )
             )
         )
     )
)

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", ""))))))

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", ""))))))

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", 
                         ""
                     )
                 )
             )
         )
     )
)
Source Link

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?