14

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}
Result
{!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

  • 1
    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. – Himanshu Jan 11 '16 at 9:23
  • 1
    @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 Jan 11 '16 at 9:36
  • @kurunve did you check with a Lookup field? - other regular fields work fine for the checks – Saariko Jan 11 '16 at 10:50
  • 1
    @Saariko yes, I have checked on lookup from account to custom and standard field – kurunve Jan 11 '16 at 10:59
  • @Saariko So, that always returns you null even if that is not null? – kurunve Jan 11 '16 at 11:15
9

Try using the "Formula evaluates to true" option to check for null with the following formula:

[Account].Account_Parent_Tiered_OBJ__c  = null
  • This behavior kind of seems like a bug. Is this approach still the recommended one? – Adrian Larson Sep 22 '16 at 23:27
  • 1
    I think the issue turned out to be that the condition was wrong, not that the "is null" check was buggy -- see the accepted answer. – shannonsans Sep 27 '16 at 3:15
5

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.

4

I faced the exact same problem with Process Builder and then the following solution helped.

Whenever we are referring a related record in Process Builder we should put a NULL value check for that field as the first condition in filter criteria.

Then use "Customize the Logic" e.g. (1 AND 2 OR 3) So if 1 fails the process will not go further.

Regards, Rosh

4

Well, I've just experienced a similar issue, but it's not exactly the same as yours.

In my case, the cause of the error was that I set the condition if the id of referenced record is null. I had to set if the field itself is null.

When we set the condition such as "[Parent].Child__c.Id isnull Boolean True", we'll get an error because "Child__c" is not set and the process failed to get its "Id".

So we have to set the condition like "[Parent].Child__c isnull Boolean True" instead.

This "Child__c" wasn't shown up with its label, but with its API name, so I couldn't find at the first time, but "Child(Label)>" was there. It's confusing.

  • is it just me, but I cant just pick "[Parent].Child__c" the builder forces me to pick a field too. – manza Jan 17 '18 at 0:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.