Salesforce Automations

Intro to Automations. 

One of the best parts of Salesforce is the ability to automate everything. 

One nonprofit Executive Director used to manually compile excel spreadsheets to for payroll and allocation purposes. Now Salesforce does most of this for her, and she estimates she saves 250 hours per year

Another nonprofit I work with has a monthly requirement to compile and email data for each of their clients to a specific funder – and what once took 5-10 hours every month is now completed in a few seconds with the click of a button.

The best part of automations is that the most tedious tasks are often the easiest to automate. So not only do you save time, you save time by avoiding the most boring work – which also happens to be the work that’s most susceptible to user error.

This is part of a series of posts providing a basic introduction to what Salesforce is and how it can be useful to you and your nonprofit. Click here to see all of the posts in this series.

Automations can be initiated from a user intentionally starting it – which mostly means pressing a button. They can also be initiated based on database changes – creating a new record or updating an existing one – or scheduling the automation to run at a particular date and time.

I’ll start by explaining some simple user-initiated automations launched from buttons.

Salesforce Buttons

Salesforce comes with many ready-to-go buttons. Some buttons launch very complex automations, other launch very simple ones. 

There are three main types of buttons which dictate where you find them: Record Buttons, List View Buttons, and Free-Floating Buttons.

Record Buttons

I’ll start with an example of a Record Button. Record Buttons do something related to the record at hand. The button “Email Acknowledgement” (highlighted in red in the screenshot below) is relatively simple. When pressed, it sends a “Thank You” email to the Primary Contact related to this Donation Opportunity record and will include the Donation Amount and Donation Date in the email.

List View Buttons

The second type of button can be found on List Views (link). 

With this type of button you can do an automation on multiple record at once. To use a List View button, you first check off the records you want the button to affect (in the red circles in the screenshot below). Then when you press the button, it will do the automation on those ones. In the case of the screenshot below, the “Send Service Report” button (highlighted in red) automatically emails those reports to the designated people..

Free-Floating Buttons

Last, you can have free-floating buttons – buttons that aren’t related to just one record or just the records found in a List View.

For example, I’ve created a few different automations for nonprofits that convert donations, billing, and expenses into a very particular accounting format. After the month has ended, they review all their records to make sure everything is in order, and then they’ll launch the automation using the free-floating button below. 

This automation processes thousands of records, so making a user check them off on a List View isn’t ideal. Instead, you just press a single button and the automation does its magic.

You’ve now seen the three types of buttons.

Next, I’ll show you another user-initiated automation that utilizes pop-up windows to provide guidance for Salesforce users to enter in data thoroughly and correctly. Then I’ll show you automations that aren’t launched from a button, but instead triggered from updates to the database, or from a schedule.

I’ll start by introducing Salesforce Flows, one of the best tools to get all this done.

Flows

Salesforce’s popularity is partially due to “Clicks not Code” mantra. 

“Clicks not Code” is a catchy way of saying that the Salesforce platform can be customized and automated through clicking a mouse (“Clicks”) rather than writing in a computer programming language (“Code”).

“Flow” is Salesforce’s most advanced tool in the “Clicks not Code” ethos. It has a graphic interface and guardrails that provide structure to create automations. 

Flows are set up by Salesforce professionals, so you may never actually see “under the hood” of the flow itself. However, it’s helpful to have a basic understanding of how they work.

Flow Example - New Client Questionnaire as a Screen Flow

Let’s look at an example involving a nonprofit that has their staff go through a questionnaire with each new client. Before Salesforce, staff filled out this questionnaire as a googledoc that they stored on google drive. But they now complete the questionnaire within Salesforce using a “Screen Flow”.

A “Screen Flow” is a type of Flow consisting of a series of pop-up windows that provide guidance and allow for streamlined input of key fields and data. I’ll show you what this particular questionnaire looks like in the example below.

To being, the questionnaire is launch from the “Intake” button (highlighted) on the Contact record.

The button then launches the first pop-up screen shown in the screenshot below. The top of this screen is displaying the data already in the Contact record (Name, Birthdate, Address, Phone, etc).

But upon scrolling down, we also are being prompted for other info that hasn’t been filled in yet (Mobile Phone, Preferred Method of Contact, Gender, Race, etc).

After we hit the blue “Next” button, it takes us to the next screen, below. This one is asking about the client’s “Service Coordinator” (no info currently filled in) and asking whether they have a “Paid Support” person.

If we choose an option other than “None” for the Paid Support person, we will automatically get a bunch more fields to fill out about the Paid Support person (highlighted). Screen Flows are flexible in that you can show or hide different fields or screens depending on what the user selects.

There are a bunch more screens like this, guiding the staff through the process of filling out the Intake questionnaire.

These types of Screen Flows can be built for all sorts of purposes to ensure information is collected thoroughly and with great accuracy.

That was a Screen Flow launched from a button. 

Now let’s look at an example of a flow that is auto-launched – that is, the user does not press a button to begin the flow. Instead, the Flow will automatically launched either when the user creates or updates a record or based on a predetermined schedule. Let’s look at two examples.

Flow Example - Donor Status to Platinum from New Record or Updated Record

Our nonprofit has a special “Platinum” program for Donors who make a single donation of $750 or more. We want to automate this, and we can use an auto-launched Flow to do it.

Let’s look at the example of Mia in the screenshot below. So far, her biggest donation is $600, which you can see highlighted in yellow. You can also see her “Donor Status” is currently “Regular” (highlighted in green).

Now let’s add a Donation Opportunity worth $800, which should trigger her Donor Status upgrade. Here’s the newly created Donation Opportunity record below worth that mount.

As soon as we add that record, Salesforce runs this “Donor Status Update” Flow in the background.

Here’s what the flow looks “under the hood” (again, don’t worry about how the flow works). Because the donation was worth $750 or more, it will go down the “Yes Upgrade” path and update the “Donor Status” to “Platinum”.

Now when we look back at Mia’s record, we see the new donation we added (highlighted in yellow) and we also see that Mia’s “Donor Status” has been changed to “Platinum” – we didn’t need to manually press a button to do this. It happened automatically based on the flow.

That’s an example of a Flow auto-launched from a record being created or updated. Now let’s look at an example of a Flow that is launched according to scheduled date and time.

Flow Example - Quarterly Reports from Schedule

In this example, a nonprofit has an important report to fill out each quarter for each of the clients. I created a “Quarterly Report” feature for them to solve this need. The staff receive a blank Quarterly Report for each client and then they must gather the most current information to complete it.

This nonprofit would like these blank Quarterly Reports to be automatically created at the start of each fiscal quarter and for the due date to be set as two weeks after the end of that quarter.

We can create an automated process to do this. Here’s what that flow looks like below. Don’t worry about understanding what’s happening below – I just want to give you a sense for it.

These scheduled flow can be set to any kind of date and time interval you want – every day, particular days of the week, weekly, monthly, quarterly, etc. They can create records, update records, delete records. Whatever you need to do, I can get Salesforce to do it for you.

In this section I’ve covered how Screen Flows can help users input information more thoroughly and accurately, and I’ve covered the different ways Flows can be launched (buttons, creating or updating a record, scheduled). 

But some automations are too sophisticated for Flows. This is where we switch from the “Clicks not Code” mentality to the “It’s Time to Write Some Code” mentality. 

That’s where Apex comes in.

Apex

Apex is Salesforce coding language that is a combination of java (an old and widely used coding language dating back to the mid 1990s) and SQL (a programming language specifically used for databases). If you aren’t familiar with programming languages, this will just look like gobbledygook. This code below copies an address on an Account to the address on any related Contacts.

public void updateAddressToContacts(List<Account> accList){
    Map<Id,Account> mapOfIdToAccount = new Map<Id,Account>();
    List<contact>lstOfUpdcontacts = new List<Contact>();
    for(Account acc:accList){
        mapOfIdToAccount.put(acc.id,acc);
    }
    List<Contact> contactList =[select MailingStreet,MailingCity,
        MailingState,MailingPostalCode,MailingCountry 
        from Contact where AccountId IN:accList];
   
    for(Contact con: contactList){
        contact con = new Contact(Id = con.Id, MailingStreet =     mapOfIdToAccount.get(con.AccountId).BillingStreet,
        MailingCity =  mapOfIdToAccount.get(con.AccountId).BillingCity, MailingState = mapOfIdToAccount.get(con.AccountId).BillingState,
        MailingPostalCode = mapOfIdToAccount.get(con.AccountId).BillingPostalCode, MailingCountry = mapOfIdToAccount.get(con.AccountId).BillingCountry);
        lstOfUpdcontacts.add(con); 
    }
if(!lstOfUpdcontacts.IsEmpty()){
    update lstOfUpdcontacts;
    }
}

It’s a Salesforce’s best practice to minimize Apex whenever possible, but I’ve utilized Apex for most of my clients – there are often a few desired automations that a Flow cannot handle. Apex is a versatile tool and extremely effective when used well.

Conclusion

Looking “under the hood” of Flow and Apex is generally not something you’ll ever have to do. We will collaborate on what we can automate, but it’s my job to actually build the automations. I include a bit of “under the hood” details here because I find it helps with the collaboration.

Making automations is one of my favorite parts about Salesforce because automating boring and tedious tasks often drastically improves the lives of my clients! Creating these automations is an investment that brings big rewards in terms of time, energy, and money.

I feel strongly that nonprofit staff who are dedicating huge amounts of their lives to contribute to building a better world should not have to get bogged down by tedious stuff that is entirely unnecessary for them to be doing. Let the computers do that and have the humans focus on the important parts!

And also please keep reading to dive deeper into what Salesforce has to offer! 

About the author 

Patrick

Patrick has been working with nonprofits for over 15 years. He has 12 Salesforce certifications and has created easy-to-use Salesforce databases for many clients, saving them thousands of hours. He has a BA and MBA from UC Berkeley and Masters in Counseling Psychology.

>