simple process builder failing with error "failed to access the value for variable because it hasn't been set or assigned"

Ok. I raised ticket with Salesforce on this and they came back saying it is a known issue(After more than a month of back and forth) and updated the Knowledge article with the work around for situations like these where Picklist fields are referenced in the formula.

NOTE: As mentioned in Known Issue W-2763830, this formula syntax does not work when using Formula-Based Criteria and making a cross-object reference to a Picklist field (specifically when using the TEXT or ISPICKVAL functions with the spanning reference to that picklist). If you need to make cross-object reference to a picklist field in Process Builder Criteria, use Condition-Based criteria. If you must use formula-based criteria, use the CASE function when making cross-object references to picklists.

URL to the known issue on this : https://success.salesforce.com/issues_view?id=a1p300000008aUBAAY

URL to the knowledge article: https://help.salesforce.com/articleView?id=000212174&type=1

In my case, I had to change the formula as below using CASE function instead of ISPICKVAL function:

Fails:

AND(NOT(ISBLANK([Case].AccountId)),ISPICKVAL([Case].Account.Active__c,'Yes'))

Works:

AND(NOT(ISBLANK([Case].AccountId)),CASE([Case].Account.Active__c,"Yes",1,0)=1)

Rather than using formula, Choose Conditions are met and use same conditions which you are mentioning in the formula, it will work smoothly.

update Case

If you do not mention the AccountId is not null then it will throw following error message.

error msg

Workaround using formulas

Breakdown the formula in 2 parts

  1. Account is Null, here just update a dummy action, as without specifying action you cannot activate the process.

Account is null

  1. Account is Active, here you can accommodate other conditions in the formula and run your desired update.

Account is active