Thursday, December 21, 2017

"The flow failed to access the value for" Error

The following error occurs in a Salesforce flow when you try to check a field on an object that is null.  For example, when you check a field on an Account record related to an Opportunity, but that Opportunity doesn't have an Account assigned.   The error will look somethng like this:
The flow failed to access the value for myVariable_current.Producing_Broker__r.MAP_Services_Not_Allowed_to_Contact__c because it hasn't been set or assigned.

To resolve this in Process Builder, you will need to check to see if the related object is present first.  In the example above, Producing_Broker__r must be checked first before trying to access Producing_Broker__r.MAP_Services_Not_Allowed_to_Contact__c field.     That looks something like this: 

In this case, the first block checks to see if Producing_Broker__c is null.  If it is null, then the Process Builder exits.  If it has a value, it goes to the next block where it can successfully evaluate Producing_Broker__r.MAP_Services_Not_Allowed_to_Contact__c. 

No comments:

Post a Comment