What Criteria to use in Process Builder to check for NULL reference?

  • I have a lookup field on account - for other accounts - Name: Account Parent Tiered OBJ

    How do I check in Process Builder that it's actually empty?

    Using the Global Constant NULL

    enter image description here

    or: IS Null true

    enter image description here

    both returned the wrong answer [there always seem to be some value there]

    • As debug, I tried to get the id/name/any value form the 'so called not null obj', but I get error:

    The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with

    So yea, it is NULL, but I just can't understand how to check for it.

    • My process

    enter image description here

    • Error report:
     An error occurred at element myRule_1_A1 (FlowRecordUpdate).
    The flow failed to access the value for myVariable_current.Account_Parent_tiered_Obj__r.Name because it hasn't

    been set or assigned.

    This report lists the elements that the flow interview executed. The report is a beta feature.
    We welcome your feedback on IdeaExchange.
    Flow Details
    Flow Name: test_account_parent_obj
    Type: Workflow
    Version: 3
    Status: Active
    Flow Interview Details
    Interview Label: test_account_parent_obj-3_Account
    Current User: Saar Machtinger (00520000000vhNm)
    Start time: 12:54 11/01/2016
    Duration: 0 seconds
    How the Interview Started
    Saar Machtinger (00520000000vhNm) started the flow interview.
    Some of this flow's variables were set when the interview started.
    myVariable_old = 00120000006zEWSAA2
    myVariable_current = 00120000006zEWSAA2
    RecursiveCountVariable = 0.00
    ASSIGNMENT: myVariable_waitStartTimeAssignment
    {!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
    {!myVariable_waitStartTimeVariable} = "12:54 11/01/2016"
    DECISION: isChangedDecision2_myRule_1_ParentId
    Executed this outcome: isChangedRule_2_myRule_1_ParentId
    Outcome conditions: and
    1. {!myVariable_old} (00120000006zEWSAA2) Is null false
    2. {!myVariable_old.ParentId} (null) Does not equal {!myVariable_current.ParentId} (00120000003rB3xAAE)
    Logic: All conditions must be true (AND)
    DECISION: isChangedDecision4_myRule_3_ParentId
    Executed this outcome: isChangedRule_4_myRule_3_ParentId
    Outcome conditions: and
    1. {!myVariable_old} (00120000006zEWSAA2) Is null false
    2. {!myVariable_old.ParentId} (null) Does not equal {!myVariable_current.ParentId} (00120000003rB3xAAE)
    Logic: All conditions must be true (AND)
    DECISION: myDecision
    Executed this outcome: myRule_1
    Outcome conditions: and
    1. {!isChangedRule_2_myRule_1_ParentId} (true) Equals true
    2. {!myVariable_current.ParentId} (00120000003rB3xAAE) Is null false
    3. {!myVariable_current.Account_Parent_tiered_Obj__c} (null) Is null true
    Logic: All conditions must be true (AND)

    NOTE: I do not have a default value on the field.

    • no field udpates or flows using this field

    enter image description here

    Global constant work for me. Can you check if there is any other criteria which is failing. It will be great if you can post screenshot of your process.

    @Saariko I have checked both of ways, and they are working. Are you sure that there are no another flows/triggers/processes that may handle it?

    @kurunve did you check with a Lookup field? - other regular fields work fine for the checks

    @Saariko yes, I have checked on lookup from account to custom and standard field

    @Saariko So, that always returns you null even if that is not null?

    No. There is no value in the tiered parent field. But the process criteria is not caught correctly

  • Saariko

    Saariko Correct answer

    6 years ago

    Always check your conditions - and than check them again, or just rewrite the process.

    My error resided in the simple solution: The condition #3 that I used, was wrong. Instead of asking for: Account->Account_Parent_tiered_Obj__c - I had to filter by: Account->Parent->Account_Parent_tiered_Obj__c

    The lesson really is to recheck your criteria.

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM