The life-changing magic of Drupal plus Salesforce


Salesforce is becoming very popular, even with organizations that don’t necessarily have “sales” in the traditional sense. For many of our nonprofit and higher ed clients, Salesforce is a great way to keep track of (and keep in touch with) their members, contacts, or students. It’s a huge improvement over the time-honored “keep all your members in a giant Excel spreadsheet” system.

If your organization uses Salesforce, or is thinking about using Salesforce, then you’re probably also thinking about getting Salesforce connected to your website. If your website is built in Drupal, then you’re in luck because there are quite a few ways to get the two platforms talking to one another, ranging from the simple to the complex.

#1 Salesforce Forms

The simplest way to hook Drupal (or any website for that matter) up to Salesforce is by simply linking over to a form that’s created by Salesforce.

How it works

A form built in Salesforce can be linked directly from the website. Any data the user enters is getting dumped directly into Salesforce and Drupal is not involved at all.

What it’s good for

This method is good for lead-generation or simple application forms. For example, NEADS is a nonprofit that trains service dogs for the deaf and disabled. They have several application forms depending on whether you need a dog for yourself or a family member, if you’re volunteering to help raise a puppy, or whether you’re interested in adopting a dog that didn’t quite pass their training program. They’ve created a regular page on their website with several links (one to each type of Salesforce form). Visitors can read the links and click the one that’s appropriate for them. No fuss, no muss.

Pros and cons

The advantage? It’s cheap and easy. There is zero setup to do on the Drupal side besides providing a link to the form. The downside is that your visitor has now left your site, but it’s probably not a big deal since you can apply some simple branding to the Salesforce form. Also, you can set up a “thank you” page that takes them back to the Drupal site once they’re done filling in the form.

If making the form look exactly like your site is important, there are ways to do so on Salesforce, or maybe you're ready for the next option.

#2 Salesforce Webforms module

This is a slightly nicer version of #1 in that the user never leaves your site, and the form is perfectly integrated with your visual style.

How it works

We set up a form in Drupal that has all the same fields of the same item in Salesforce. For example, if we’re collecting Name, Email, and a drop-down menu for how you heard about us, we’d need those fields to exist in both Drupal and Salesforce.

Then we install the Salesforce Webforms module in Drupal, and tell which field in Drupal maps to which field in Salesforce. Voila! Now when your users fill in the form in Drupal, the content magically ends up in Salesforce but the user never sees that happen.

Pros and Cons

Like we said, it’s a more seamless experience for your visitors. It’s still relatively easy to set up, so the time and cost are not prohibitive. The one downside is that the connection between the two systems isn’t automatic. If you ever need to add or change any of the form's fields, that change must be made on both Salesforce and Drupal, and the connection must be properly maintained.

#3 Salesforce Mapping Module

If you ever have content that lives in both Drupal and Salesforce and needs to stay in sync, the Salesforce Mapping Module (one of the suite of modules in Salesforce API module) has you covered.

What it’s good for

A classic example is the user profile. Let’s say you’re like our client ICA Teens and you offer workshops that run for a semester or a school year. Many of those workshops repeat a few times a year. In Salesforce, you need to keep track of which students took which class, and which instance of that class (e.g. spring or fall) they took.

On the Drupal side, your students can log in to update their contact information and other demographic info, and at the same time they can create portfolios of the work they did in class. You don’t need their artwork in Salesforce, but you do need their up-to-date contact info.

Furthermore, if a staff member updates a student’s info in Salesforce, you’d want that to sync back to their Drupal profile.

The Salesforce Mapping module keeps the two versions of the profile—on the Drupal and Salesforce sides—in sync. Whatever happens to one happens to the other. You can also make rules about what happens when you add or delete profiles. In the ICA Teens’ case, they established that any new user who registers in Drupal creates a new person in Salesforce, but deleting somebody from Drupal should not delete them in Salesforce and vice versa. They had reasons to sometimes keep past students, and their portfolios, around.

Pros and cons

The content mapping is a bit more time-intensive to set up and test on our end, and it’s best if you can make thoughtful rules about what happens to content that’s added, changed, or deleted on either end and stick to them.

Of course, the time and cost to set up is nothing compared with the time and cost of manually double-entering the same content in two places. Not only will that waste staff time, it’s also more prone to error. Definitely talk to us if you are experiencing this agony.

#4 Custom Drupal code + Salesforce API

This is where it gets exciting. (For us, anyway; we’re nerdy like that.) Sometimes what you need to have happen doesn’t fit neatly into what the existing Salesforce modules can do. The beauty of Drupal is that when features don’t exist, we can write them ourselves. Pair this with Salesforce, which provides an excellent API to help us get at the data, and we can do anything we want.


A great example of a custom Drupal-Salesforce integration is one we built for the New England Foundation of the Arts (NEFA). One of NEFA’s many activities is making grants to artists in the performing arts.

Their Salesforce instance contains all of their grant programs, all their artists who have received a grant, and what year they won it. To complicate matters, sometimes an organization or studio wins a grant, and that studio is comprised of several artists.

Let’s say that Bob Smith has received 3 NEFA grants in his career. He’s received the Artist Grant twice (in 2008 and 2013) and he received the Dancer Grant once (in 2017). 

Logging into Salesforce, staff can easily see these relationships, since Bob’s profile is linked to both grant programs and vice versa.

But for outside users using the website to search grant recipients, it’s another story. They might search by an artist’s name or a grant name and need to see the connections between the artist, the grant, and the year. We need to end up with something like:

Artist Grant Year
Bob Smith Artist Grant 2008
Bob Smith Artist Grant 2013
Bob Smith Dancer Grant 2017

We wrote code on the Drupal side to make this happen. Every so often (typically after their grant season ends), staff at NEFA log into Drupal, then click a button to generate the new list. Our custom code queries Salesforce to find out which grants have been awarded since the last crop of grants. It finds out which artists (or groups of artists) received the grants, and which year is appropriate to use here—because, just to make things fun, a grant season sometimes straddles the line between years. Grant name, artist name(s), and year are compressed into a single Drupal content type, “grant recipient”. The new grant recipients are much simpler than the complex relational data in Salesforce, but that’s the point: they’re perfect for simply displaying on the web side. 

Pros and cons

Whenever you hear “custom code,” prepare for a longer and more expensive project. But custom solutions like this might ultimately benefit your organization if they can reduce staff time and increase user engagement. And as you can see above, they’ll let each system do what it does best: Salesforce can stick to its strength of data management while Drupal handles the beautiful display of information.

What would you like to do?

These are the broad strokes of what Salesforce and Drupal make possible. If you take one idea away from all of the above, it should be this: there's definitely an integration that will work for your organization's needs and budget.

If you already have a Salesforce instance set up, we'll be happy to explore the appropriate integration options. If you're new to Salesforce, we can work with your Salesforce developers to make sure your data is structured in a way that minimizes the integration effort and costs. Get in touch and we'll figure everything out with you.

Share the Love