Salesforce Automation: The Next Generation

Lizette CZ
7 min readDec 13, 2021

Discovering a New Automated Frontier

I just came back from my last mission — I apologize for the long absence. Command for Talent Stacker needed a team to create a Donor Management system in Salesforce. On ground control, there was a TS project manager with a long list of requirements and she said she’d get us a team of 4 explorers, but when it was time to launch, it was just a team of 2. You might say, “Oh no, May the Force Be With You,” but that would be the wrong movie. Anyway, I got paired up with the most AMAZING partner — Abby. We went to the edge of the universe and successfully returned as heroines! We were able to build automations — mainly using Flows — with the goal of making the life of a User easier.

Automations streamline your processes, makes you faster, consistent and can add an extra 10 minutes to your lunch break. I say, make the system work for you so you have to less to manage. Let’s face it, you have some Klingons with weapons to worry about. In the midst of battle, you could forget to check a field on a record or send out an email! Then what — errors, inconsistencies!

Automation rules in Salesforce never forget to run…They’re always in the background — waiting to be called upon for their next mission!

In our Giving Tree Foundation Salesforce app, we created automations to update fields, set good practice parameters so Users make less errors and the system can even be on the lookout for a certain criteria and send you reminders to do a task when that criteria is met.

The first automated feature is a custom formula field that calculates a person’s current age when a User inputs a birthdate. What’s the big deal? A formula field is dynamic so it will update the person’s age when the current year changes or the Birthdate field data changes.

Birthdate entered, Age = 48
Year updated to 1963, Age = 58

Here’s how we did it! Created a custom field “Age,” set it up as a Formula field with a return data type as Number.

Then enter the formula: IF( NOT( ISBLANK( Birthdate ) ) , IF( DATE( 2000 , MONTH( Birthdate ) , DAY( Birthdate ) ) <= DATE( 2000 , MONTH( TODAY() ) , DAY( TODAY() ) ), YEAR (Today()) — YEAR ( Birthdate ), YEAR (Today()) — YEAR ( Birthdate ) -1 ), null)

The second automated feature is a flow that does several updates on a record:

The start element of this flow tells it run whenever a record is created or updated, with no conditions and make the updates after the record is saved:

Start element

The second element of this flow, is telling it what to look out for — the Donor (Contact) record :

Get Record element

The third element of this flow, is the first job. When the Do Not Contact field is checked, then check the fields Do Not Call and Email Opt Out:

Update Records Do Not Contact element

So when a Donor tells our Salesforce User that they don’t want to be contacted, the User clicks on the “Do Not Contact” field and the flow does the rest. It even recognized the reverse. When “Do Not Contact” is not checked, it will uncheck the other fields.

The next element in the flow is the Decision tree.

We are setting the criteria (Total Gifts) so the system can categorize the 3 different Donor Levels (Major, Secondary and Small). It’s a tiered structure so we set the criteria as $ ranges.

Major Donor criteria
Secondary Donor criteria
Small Donor criteria
The Default is created by the system if you need to create a path if the criteria are NOT met.

Once you’ve set the decision, then you can create the action element that is needed when the criteria is met. You’re basically defining an “If, Then” path for 3 different scenarios. In this case, we needed the system to automatically update the Donor Level field with the correct value based on the criteria ($ amount stated in the Total Gifts field). Notice, in the flow, we did not have to create a path for the default. The Donor Level is defaulted to None and there’s a Validation Rule that restricts a Donor Level to be entered if Total Gifts = $0. I’ll show you the VR later.

Since the course has already been set for the SS Enterprise, each Update Record element specifies what value to be entered into the Donor Level field. No further criteria needs to be set because the Decision already determined the path and we always want this update to happen on this path.

Major Donor is entered into Donor Level on this path.
Secondary Donor is entered into Donor Level on this path.
Small Donor is entered into Donor Level on this path.

The User sees this automatic update on their Donor record.

If a Donor has a $ amount over $500 in the Total Gifts field:
Then the Donor Level is updated to “Major Donor.”

The last element on this flow only pertains to a Donor that has reached a Major Donor level. It’s creating an automatic email to be sent to the record owner alerting them that a Donor has reached this level and needs to be sent a Thank You kit.

Action to Auto send an email

An email is automatically sent to the User who is the Donor record Owner from the User who created the Donor record. You can enter the Title of the email in the Subject field and use an email template that you’ve already created in this Flow. You can create the Body (email template) as a text template variable. In this email template we are sending a reminder to the record Owner to send a Thank You Kit to the Donor and the template can include merge fields by using the “Insert a resource” box.

The Email Template can be located in the Manager tab and you can use the “insert a resource” to add record information into the text (merge field).

This is what the email looks like to the receiving User. See in the email, we’ve even customized it to include the mailing address so the User doesn’t have to look for the Donor’s address:

Email sent to Donor record owner.

In my next post, I’ll be showing you some other automations that were built for the GTF Donor Management system. In the meantime…

Our Mission is complete.

Mahalo,

Lizette

--

--

Lizette CZ

Salesforce Magician + Home Chef Enthusiast + Fun Size = ME!