Loading

Process Builder Error 'The flow failed to access the value because it hasn't been set or assigned'

Julkaisupäivä: Jul 7, 2026
Kuvaus

A Process Builder process that makes a cross-object reference will fail when the relationship field (foreign key) the reference depends on is not populated. For example, a Process on Contact with the criteria [Contact].Account.Name equals Acme will fail when it is triggered on a Contact where the Account field is blank. The error generated in Debug Logs is: "The flow failed to access the value for myVariable_current.Account.Name because it hasn't been set or assigned."

Ratkaisu

Preventing Null Reference Errors in Process Builder Criteria

To avoid this type of error, always check whether the lookup field is populated before making cross-object references based on that field.
The order of criteria matters. The check to verify that a lookup is not null must appear before any condition that makes a cross-object reference across that lookup.
Using the Contact-Account example: add the criteria [Contact].AccountId Is Null False before the criteria [Contact].Account.Name equals Acme, in that order. The null check for AccountId must come before the cross-object reference to the Account field.

Using Condition-Based Criteria

When using condition-based criteria, ensure the null check for the lookup field itself (for example, [Contact].AccountId) is listed first. A common mistake is checking [Contact].Account.Id, which is a cross-object reference to the Account's Id field and will also fail when the Account lookup is blank. Always check the lookup field on the current object, not the related field.

Using Formula-Based Criteria

When using Formula evaluates to true in the Criteria for Executing Actions, the following formula pattern prevents null errors:
AND (NOT(ISBLANK([Contact].AccountId)), [Contact].Account.Name = "Acme")
This checks that AccountId is not blank before evaluating the cross-object reference. Note: This formula syntax does not work when making cross-object references to Picklist fields using the TEXT or ISPICKVAL functions (see Known Issue W-2763830). For cross-object references to picklist fields, use Condition-Based Criteria. If formula-based criteria must be used, use the CASE function for cross-object picklist references.




Knowledge-artikkelin numero

000382782

 
Ladataan
Salesforce Help | Article