PRO TIPS

Integration with Salesforce Using Zapier

A headshot for Jay Mehta, Prolocity's PROserve Essential lead

Jay Mehta
PROserve Essentials Lead

AppExchange packages are great, but not every vendor offers them. A common example is QuickBooks Online–it's very common for our for-profit customers to have a business process that requires them to create a customer in QuickBooks after an Opportunity is closed in Salesforce. While Intuit doesn't offer an AppExchange package to do that, there are some third-party packages that enable this functionality at additional cost.  But because QuickBooks offers an Application Programming Interface (API), there's another option–an integration tool that's designed to connect multiple platforms and allow you to perform actions on them.

There are many tools with wide ranges of pricing–at the higher end, platforms like MuleSoft or Informatica promise the ability to connect and automate just about anything. They're powerful, but require significant technical knowledge and come at considerable cost. So in this article, we'll focus on less expensive tools that are geared toward everyday admins like Make and, in particular, Zapier.

What's Zapier?

Zapier allows you to create Zaps that link multiple systems together and lets you do two big things: respond to triggers and perform actions. If you've ever built a Flow in Salesforce (which we'll discuss in a later article), this may sound familiar–the theory is exactly the same. But Zapier lets you do this across different services. We've used QuickBooks as an example, but Zapier offers over 7000 pre-built integrations.

One additional concept to be aware of is that every action that is successfully completed in a Zap counts as a task in Zapier, which is how Zapier calculates billing–each of its plans offers a set number of tasks per month. A long, complicated Zap may use multiple tasks.

Zapier offers the ability to listen for triggers in Salesforce to push data to an external system, or to listen for a trigger in an external system and push that data into Salesforce. You can also push data to multiple systems–for example, closing an Opportunity in Salesforce can not only create the customer in QuickBooks, but also add a project board in Trello, and create a folder in Google Drive or SharePoint. You could even then update the closed Opportunity at the end of the process with links to the board and folder you created in your Zap.

That's the theory; let's look at how it works in practice. In this post, we'll create a simple Zap that watches for an Opportunity to be marked as Closed Won, creates a folder in Google Drive that matches the Opportunity name, and then updates the Opportunity record with a link to the folder.

Setting the Trigger

We won't walk through the signup process, but know that to integrate with Salesforce, you'll need a paid Zapier account at the Starter tier or above to unlock the Salesforce integration. Once you've created your account and logged in, click the Create button on the home page.

The first thing we'll do is specify the Trigger–the action that should kick off our Zap. In this case, we want to monitor Opportunities for a change to the Status field; if that field is changed to equal Closed Won, the actions should run. To do this, we'll click the Trigger box in the Zap editor. That will open a screen that allows you to search for apps–we'll pick Salesforce here (you may need to type it into the search box to find it).

 

Zapier's Trigger and Action editors–clicking one opens a dialog box that enables you to configure the step.
The app selector for a Trigger. Clicking an app allows you to continue configuring its options.

After you select the app, you'll need to select the event that triggers your Zap. Each different app has different events to select from, so we can't provide a comprehensive list, but in this case, the option we're going to pick is Updated Field on Record, because we're interested in when the Opportunity's Stage field is changed. Select that and click Continue.

On this step, you'll need to select a Salesforce account to use. In this example, we've already authorized a couple of Salesforce orgs, so I'll pick the correct one from the list. But you should know that the first time you use an app in a trigger or action, you'll need to authorize it with a username and password. Zapier will walk you through this process. It's something you only need to do one time, and Zapier will then store the credentials securely for future uses. After you've selected an account, click Continue.

Account Selector screen-after picking an application, the next step is to pick the Account you'll use to sign in. You'll need to authorize the application one time, but after that, Zapier will remember the credentials.

Here we'll set the object, field, and value that are our trigger. The object is Opportunity, the field is Stage, and in our org, the value is Closed Won, so we'll set those values.

The event configuration screen. For Salesforce triggers, you need to pick the object, field, and value you wish to trigger the Zap on this screen. In this example, we picked Opportunity as the object, Stage Name as the field, and Closed Won as its value.

After clicking Continue, Zapier will ask you to test the settings. This is a vital part of developing Zaps–testing pulls a record from Salesforce so that you can use it in subsequent actions. This is a good chance to jump to Salesforce and update an Opportunity match your expected criteria. That way, Zapier can pull the record over.

 

After you click test, Zapier will show a few matching records and preview their content. Select one and click Continue with Selected Record.

Zapier's Trigger and Action editors–clicking one opens a dialog box that enables you to configure the step.
The app selector for a Trigger. Clicking an app allows you to continue configuring its options.

Performing a Single Action

Now that we've set a trigger, Zapier lets us start defining actions. In this case, we'll select Google Drive, and then set the event to Create Folder. From here on out, the process will look very much like the trigger setup. Zapier will ask you to pick our authorize a Google Workspace account, and then it will ask you to pick a drive (either a Team drive or personal drive) and a parent folder (which is optional).

Here we'll also set the folder name. This could be text value you type into your Zap, but that's not super useful. It would probably make more sense for the folder to be named for the Opportunity. Luckily, Zapier makes this easy to do. Simply click the Folder Name field, and you'll see that Zapier brings up an Insert Data selector that shows the record we selected from our trigger, along with all of its field values. Simply select the trigger, and then select the Name field. You'll see Zapier fill in the Opportunity name populate the Folder Name box.

A correctly configured Zapier setup that instructs it to name the folder it creates in Google Drive using the Name field pulled from the Trigger we previously set up. Click Folder Name, then click the trigger under Insert Data, and scroll to the Name field.

Click Test, and you should see a confirmation that the folder was created on Google Drive. Open up your Google Drive and you'll see the folder there as well.

Chaining Actions

We could enable this Zap and call it a day, but one of the nice things about Zapier is that it allows chaining further actions, both in the systems we've already used and in others. In this case, we'll update a field on the Opportunity that triggered our Zap to have a link to the folder we just created.

First, we'll click the Add a Step button, which will bring up the app selector again. Here, we'll pick Salesforce again, and then pick Update Record before clicking Continue. Zapier will auto-select the same account we used in the trigger, so you can just click Continue.

On the action step, we'll select Opportunity as the object we're updating. Under record to update, Zapier will provide a list of Opportunities it finds in your org... but that's not very helpful, because we really need to be able to dynamically identify a record, not hard-code the selection into the Zap. That's where the handy "add search step" button comes into play.

When we click the add search step button, Zapier adds another action to find a Salesforce record, and then automatically connects its output to the update action we're configuring. Candidly, we could have done this manually, but following this process makes it a little easier.

Zapier's notification to add a search step to find the correct Salesforce record before updating it. Clicking the Add a search step button adds the step to the Zap and links it to the Update record step we've already created.

Zapier then opens the Find Record action. Here again, we'll enter Opportunity, which will then reveal a Field to Search By menu. You can pick any field on the Opportunity object, but in this case, it makes the most sense to use the Opportunity ID field. Because we have the record ID from the trigger, we can re-use it here. Simply click the Search Value field, and then select the Object ID field from the list.

The ID selector for search steps. Selecting the trigger from step 1 and inserting the object ID tells Zapier to search for the Opportunity that triggered the Zap so that it can update the Google Drive Link field.

Zapier offers error handling options on whether it should proceed if no matching record is found, or create one. In this case, it's impossible for a matching record to not be found, so we'll ignore those options and test the step to make sure the record is found.

Now, we can return to the Update Record step and click Action again. We should see the list of fields on the Opportunity object (if it's not shown, click the Refresh button). Finally, scroll through the fields to find the ones you wish to update. In this case, we have a field called Google Drive Link, which I'll set to be the link from our create folder action–Google labels this as the Alternate Link among the several different link types you'll see.

Configuring Zapier to insert the Google Drive link into the Opportunity record via update. The value you'll want to use from Google Drive is the Alternate Link field.

Complete the step and test it one final time; you should see it succeed. If you view the Opportunity in Salesforce, you should also see that the Google Drive Link field is populated. If everything looks correct, you can click Publish on the Zap so that it runs from here on out.

Next Steps

We've built a simple Zap that meets a basic business need. So far, so good! We could extend this Zap to do other things (like create a project in Asana or Monday.com, or add a customer in QuickBooks). We could also, obviously build other Zaps to automate other processes.

But some of the drawbacks we've seen in other integration methods can also apply to Zapier. As you were configuring triggers and actions, you may have noticed that there were only a pre-defined Apps and Events. What if we wanted to integrate an app that wasn't listed, or perform an action that wasn't shown? Depending on the exact action and service, Zapier may be able to do the trick using an action type it calls a webhook.

Also keep in mind cost! Zapier's plans are billed by the task performed. In the example Zap we just built, each successful run will consume three tasks. So, you'll need to do some capacity planning to figure out how many times that Zap will run in a given month to make sure the Zap won't go over the budget. If it does, Zapier won't automatically charge you for more tasks (unless you opt-in to usage based billing), it'll simply stop processing Zaps until your task "bucket" refills at the start of the next month.

If you have concerns on either of these scores, our next two strategies may become more attractive–Flow and HTTP Callout, or custom code.