Skip to content

Gravity Forms Salesforce Integration: Send Leads and Cases (Tested)

How to connect Gravity Forms to Salesforce with the official add-on, tested with Leads, Cases and duplicate updates, plus the free CRM Perks and Zapier options.

Chris Eggleston 7 min read

The easiest way to connect Gravity Forms to Salesforce is the official Gravity Forms Salesforce Add-On, which comes with an Elite license. You connect your Salesforce org, then add a feed that maps form fields to a Salesforce object, such as a Lead, Contact or Case. If you don’t have Elite, the free CRM Perks plugin or Zapier are the alternatives. I set up the official add-on on a test site with a Salesforce Developer Edition org. One form creates a Lead for new projects and a Case for support requests, and a repeat submission updates the existing Lead instead of creating a duplicate.

Your Options at a Glance

OptionCostGood forWatch out for
Gravity Forms Salesforce Add-On (official)Included with Elite ($259/year) or NonprofitLeads, Contacts, Cases or any other object, with duplicate updates and conditional feedsFixed values (like a Case priority) need a hidden field or a small code snippet
CRM Perks Salesforce pluginFree, with a paid Pro versionBasic create-or-update on a Basic or Pro licenseCustom fields, linking records together and file uploads are Pro only
Gravity Forms Zapier Add-OnPro license or higher, plus a Zapier planMulti-step automations that touch several appsAnother monthly bill, and the mapping lives in Zapier, not WordPress

Whichever you choose, your Salesforce edition needs API access. That means Enterprise, Unlimited, Performance or Developer Edition; Professional Edition needs Salesforce’s API add-on. To test without touching your live data, sign up for a free Developer Edition org, which is what I used here.

How to Connect Gravity Forms to Salesforce (Official Add-On)

The form for this walkthrough is a “Project Inquiry” form with name, email, phone, company, website, an industry dropdown, a “What can we help with?” choice (A new project / Support for an existing site), a subject that only shows for support requests, a message, and a hidden “Lead Source” field set to Web.

1. Install the add-on and connect your org

Install the Salesforce Add-On from Forms → Add-Ons. Then go to Forms → Settings → Salesforce and click Connect. Salesforce asks you to log in and approve access. The add-on uses the Gravity Forms External Client App, and the settings page links to its install page if your org doesn’t have it yet. When it’s done you’ll see the org’s address in green:

Gravity Forms Salesforce Add-On settings showing Connected to Salesforce account and a Disconnect from Salesforce button

2. Create a feed and pick the object

Open your form and go to Settings → Salesforce → Add New. Give the feed a name and choose the Object Type. The list contains every object your org allows the connection to write to, so you’ll see Lead, Contact, Account, Case, Opportunity and any custom objects, plus a long tail of system objects you can ignore. After you pick one, the field mapping for that object loads below.

Salesforce feed settings in Gravity Forms with Object Type set to Lead and Last Name, First Name and Company mapped to form fields

3. Map your fields

Each Salesforce field gets a dropdown of your form fields. For a Lead, map at least Last Name and Company (Salesforce requires both), plus whatever else you collect. I mapped the Name field’s First and Last inputs, Email, Phone, Company, Website, the message to Description, the hidden field to Lead Source, and the dropdown to Industry.

Salesforce Lead field mapping with Phone, Email, Website, Description, Lead Source and Industry mapped to Gravity Forms fields

Two things that save trouble with picklist fields like Industry, Lead Source or Status:

  • Match the values exactly. My Industry dropdown uses Salesforce’s own values (Technology, Retail, Healthcare, Education, Not For Profit, Other). A value Salesforce doesn’t know can make the record fail or add a value you didn’t want, depending on how the picklist is set up.
  • Use a hidden field for fixed values. The mapping only offers form fields, with no box for typing a fixed value. To send the same Lead Source on every entry, add a Hidden field with that value as its default and map that field.

4. Turn on duplicate updates and add a condition

Below the mapping, Attempt to update duplicate records tells the add-on what to do when Salesforce says the record already exists. Under Feed Conditional Logic I only run this feed when “What can we help with?” is “A new project”.

Attempt to update duplicate records toggle turned on and feed conditional logic set to What can we help with is A new project

Save the feed, submit a test entry, and open the entry. The add-on adds a note with the new record’s ID, for example “Created Lead object in Salesforce”. Feeds run in the background, so the note can take a few seconds to show up.

How Duplicate Records Are Handled

The add-on doesn’t search for duplicates itself. It creates the record and lets Salesforce’s Duplicate Rules decide. New orgs come with a standard Lead duplicate rule that’s already active, and that was enough in my test:

  • Toggle on: the same person submitted again with a new phone number and message. Salesforce flagged the duplicate, and the add-on updated the existing Lead (same ID) instead of creating a second one. The entry note says “Updated Lead object”.
  • Toggle off: nothing changes in Salesforce, and the entry gets an error note naming the existing record.
Gravity Forms entry note: Updated Lead object, showing the existing Salesforce Lead was updated instead of duplicated
Toggle on: the existing Lead is updated.
Gravity Forms entry note: Salesforce found a duplicate record but updating is disabled in the feed settings
Toggle off: an error note, and Salesforce is left alone.

An update overwrites every mapped field, so the Lead’s Description became the latest message and the first one was gone. If you need the history, keep the message out of the Lead mapping, or send each request as its own Case or Task.

Send Support Requests to Salesforce Cases

You can add as many feeds to a form as you like, and each one has its own conditions. I added a second feed for the Case object that only runs when the visitor picks “Support for an existing site”, so one form now feeds sales and support:

Two Salesforce feeds on one Gravity Form: New project to Lead and Support request to Case, both active

In the Case feed I mapped Subject, Description, and the hidden “Web” field to Case Origin. The catch is that the Case mapping in my org had nowhere to put the visitor’s name, email or phone. Case only links to people through Contact ID, which a form doesn’t know, and Salesforce’s “Web Name/Web Email” fields weren’t available to the connection.

Salesforce Case feed field mapping with Case Origin, Subject and Description mapped and no fields for the visitor name or email

The add-on has a filter, gform_salesforce_object_data, that lets you change the data just before it’s sent. This snippet adds the contact details to the top of the Case description and sets a fixed type and priority. Change 50 to your form ID and the input IDs to match your fields, then add it with WPCode or your child theme’s functions.php:

add_filter( 'gform_salesforce_object_data_50', function ( $body, $form, $entry, $feed ) {
	if ( rgars( $feed, 'meta/objectType' ) !== 'Case' ) {
		return $body;
	}

	$contact = sprintf(
		"From: %s %snEmail: %snPhone: %snWebsite: %s",
		rgar( $entry, '1.3' ), // First name
		rgar( $entry, '1.6' ), // Last name
		rgar( $entry, '2' ),   // Email
		rgar( $entry, '4' ),   // Phone
		rgar( $entry, '5' )    // Website
	);

	$body['Description'] = $contact . "nn" . rgar( $body, 'Description' );
	$body['Type']        = 'Question'; // Must be a value from your Case Type picklist.
	$body['Priority']    = 'Medium';

	return $body;
}, 10, 4 );

My test request became Case 00001003 with the subject, Origin “Web”, Type “Question”, Priority “Medium”, and the name, email, phone and website at the top of the description. The same filter works for any object. Use it for fixed values, combining fields, or reformatting a value before it reaches Salesforce.

The Free Option: CRM Perks

If you’re on a Basic or Pro license, the CRM Perks Salesforce plugin on WordPress.org is the free route. It connects with OAuth and maps fields to Leads, Contacts, Accounts, Cases and other objects. It can create or update records, lets you send entries manually, and keeps a log of what was sent. The paid Pro version adds custom fields, linking one record to another (such as an Account to a Contact), record owners, campaigns and file uploads. I tested the official add-on for this post, not the CRM Perks plugin. I’ve used their other CRM add-ons over the years and they’ve been solid.

Using Zapier Instead

The Gravity Forms Zapier Add-On sends each entry to Zapier, and Zapier creates the Salesforce record. It comes with Pro, Elite and Nonprofit licenses, but you also pay for a Zapier plan, and Salesforce is a premium app there. It makes sense when one submission needs to update Salesforce and several other tools. If Salesforce is the only destination, the add-on keeps everything in WordPress, with entry notes that show what happened.

Things to Know

  • Tested with Gravity Forms 3.2 and Salesforce Add-On 2.0.1 on a Salesforce Developer Edition org.
  • If a feed fails, the error is added to the entry’s notes. The add-on also adds a “Salesforce Feed Failure” notification event, so you can email yourself whenever a record isn’t created, including a duplicate that wasn’t updated.
  • For payment forms, add a feed condition like Payment Status is Paid so the record is only created once the payment goes through.
  • The add-on can also be a step in a Gravity Flow workflow, for example creating the Salesforce record only after someone approves the request.

Frequently Asked Questions

Does Gravity Forms integrate with Salesforce?

Yes. The official Salesforce Add-On comes with Elite and Nonprofit licenses and sends entries to any Salesforce object, such as a Lead, Contact or Case. On other licenses, use the free CRM Perks plugin or the Zapier Add-On.

Which Salesforce editions work with Gravity Forms?

Editions with API access: Enterprise, Unlimited, Performance and Developer. Professional Edition needs Salesforce’s API add-on. A free Developer Edition org is the easiest way to test.

Will Gravity Forms create duplicate Leads in Salesforce?

Not if Salesforce has an active duplicate rule and the feed’s “Attempt to update duplicate records” option is on. In that case the existing record is updated. With the option off, the entry gets an error note and nothing is changed.

Can one form send to different Salesforce objects?

Yes. Add one feed per object and use feed conditional logic to choose which one runs, for example a Lead for sales inquiries and a Case for support requests.

Need More Help?

If you still need help, use the chat or leave a comment below and we’ll get back to you.

Comments

Ask a question or leave a comment

Your email is never shown. For help with a specific form, share what you expected and what happened instead.