During Email to Case process, I built a process builder which runs on the email message objects and checks for multiple conditions before executing actions

Here's a scenario:
(If it is incoming email and case status is closed)

[EmailMessage].Incoming = true &&

Then Reopen the Case

Problem is that now when using standard Salesforce "Send EMail" action is used from contact or opportunity (email quote/pdf) - I get the following error:

Error element myDecision (FlowDecision).
The flow failed to access the value for myVariable_current.Parent.Status because it hasn't been set or assigned.

I believe this is because, even when sending email, it checks the process builder condition and does not find a case associated to the email message being sent and hence fails

Correct me If I am wrong

Now, I have to fix it and they way I have done it is that,

I have taken a new condition at the top of process builder which checks if incoming email is False then update email message status as existing status which is essentially a dummy update.

Is there any other way I can achieve this without code.?

Please advise

  • why not have the PB check the value of EmailMessage.ParentId (1st three chars) to stop if not 500 ? – cropredy Nov 25 '19 at 19:10
  • I can add any condition, but still it will check ISPICKVAL([EmailMessage].Parent.Status,"Closed") condition and then fail. – Pankaj Gupta Nov 25 '19 at 19:34
  • I Want something like If Incoming Email is True -> Only then check next set of conditions > Else stop Problem is I even tested nested IF but still it checks all conditions under Nested IF and again fails on finding the condition ISPICKVAL([EmailMessage].Parent.Status,"Closed") – Pankaj Gupta Nov 25 '19 at 19:35
  • 1
    have the first decision block STOP if LEFT(TEXT(EmailMessage.ParentId),3) <> '500' this will exclude all emailmessages not associated to a Case – cropredy Nov 26 '19 at 0:09

Your Answer

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

Browse other questions tagged or ask your own question.