I am new to salesforce and I have already gained some experienced writing apex code to get things working, but then it was pointed out to me that certain things can be done using process builder and I dont have to code for anything. I've never used process builder before and I was wondering if the below process is easy to enough to create using process builder.

Here is the requirement:

Salesforce does not automatically match the "Student Email (Case)" field against the Contact's Email or Alternate Email. Please add a process to lookup and associate a Contact to a Case based on the email listed in Student Email (Case). This should happen after the Case is created.

If there are no matches by that Student Email (Case), leave the Contact blank. If there is an exact match, associate the case with the matching Contact.

1 Answer 1


Unfortunately, Process Builder doesn't have the capability to query the existing records by itself. However, Flow does. You could create a flow that sets the email as a variable and then queries it.

It's best to use declarative tools if you think the requirements will change very frequently. Or if you'd like to empower a non-coding System Admin to make changes.

But if the above considerations don't apply, I'd just code it in Apex. The code will better handle edge-cases such as multiple returned results. And the unit tests will help you avoid keying in records over and over during your testing.

I hope this helps!

  • You were right. And I ended up doing it using apex anyway
    – manb
    Nov 5, 2020 at 17:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .