Salesforce.com Process Builder: Writing Sophisticated Code without Being a Programmer - Guest Blog Post

Want more Salesforce fundraising insights? Check out our PUB Crawl newsletter to get them delivered straight to your inbox.

We're proud to feature this guest blog post by Ashima Saigal, Founder of Database Sherpa. Database Sherpa is a Salesforce.com consulting firm serving nonprofit organizations and a Soapbox Engage Partner.

Ashima Saigal, Database Sherpa By Ashima Saigal, Founder, Database Sherpa

Salesforce does it again, working toward their mantra of Clicks Not Code, with Process Builder. Released in Spring 2015, Process Builder takes Workflows and Visual Workflows to the next level. You can create records, update fields on any related record, launch trigger-ready flows (immediate or scheduled), send an email, post to chatter and submit for approvals with Process Builder.

So, what does this mean for a nonprofit?

First, you don't need to hire a developer if you want to update a record from a connected record. For example, let's say you want to update the Contact's email address on Lead Conversion. As you may know, the Lead Conversion process will update empty fields, but will not update fields that already have data in them. Perhaps you want to always keep that email address up to date from a Soapbox Engage form or some other external web form. So, it's required that the email address be updated every time a Lead is converted.

First, we should begin by writing out our requirements. So, this might look something like this:

When a Lead is Converted, then ALWAYS update the Contact's email address from the Lead.

So, we first need to understand how the Lead Conversion works. When a Lead is converted, there is a Contact that is either created or updated. That Contact is related to the Lead and the Lead is marked as Converted. Read more here if you want to get into this further.

{loadposition blog-ad-general}

We want to augment this process by forcing the email address to be updated regardless of whether the email address has any data in it on the Contact.

So, we want to start with Leads. We're interested in starting this process anytime a Lead is created or subsequently edited.

Then, we have a decision point. What will help us decide if we should move forward with updating the email address? If the Lead is Converted! How do we know that? There are two fields I am choosing to look at: IsConverted which is a true or false field telling me if the Lead has been converted or not. Second is the ConvertedContactID, which contains the ContactID of the Contact that was converted. To get more details about each of the various Lead fields available, please visit here.

Here is what my logic would look like:

alt

Now, I can take action. I can either schedule an action for a later time based on a date on the Lead or have an action take place immediately. I am going to choose immediately as I want that email addresses updated.

So, I'm going to update the Converted Contact email field with the Lead email field:

alt

If I had an action to take place for the false portion of the Lead is Converted (like if the Lead is NOT converted, but it was Updated or Created), then I could continue with another Criteria, however, in my case, this is completed and the process should Stop.

Here is what the Process Builder creates for me:

alt

Once the process is activated, it cannot be edited further. However, you are able to clone the original process, create a new version and then edit the new version. Maybe in my case, I heard from the user that they loved the fact that email was updated, but could I also update the cell phone number always as well.

First, we need to deactivate the process and clone it. Then, we can edit the process (give the process the same name and perhaps a version number. In the description, put the details of what is happening with this process).

So, we add another Immediate Action called Update Cell Phone:

alt

Now our new action is added to the process:

alt

And, we can activate this version of the process. So, when a Lead gets converted, the Lead's email and cell phone number will replace the Contact's existing email and cell phone number.

Here is the existing Contact information:

alt

Here is the Lead before conversion:

alt

We convert the Lead and the process we created is triggered. Then, the new Contact detail:

alt

So, start looking at Process Builder to replace the code you thought you'd need to write. It could be just what you're looking for!

UPDATE: The original text stated that the Process Builder was "Currently in Beta and available by request". It was changed to reflect its inclusion in the Spring 2015 update.

Want more Salesforce fundraising insights? Check out our PUB Crawl newsletter to get them delivered straight to your inbox.