• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

We’re currently booked and will be ready for new projects in late April 2023.

Questions? Call 254.340.0086 or send an email to [email protected].

Elodin Design

WordPress Design & Development

  • About
    • About Jon
    • Why ‘Elodin Design’
  • Websites
  • Services
  • Process
  • Blog
  • Repos
  • Contact

How to connect Gravity Forms with Salesforce web-to-lead using Gravity Forms’ Webhooks addon

December 5, 2019 by Jon Schroeder 3 Comments

I’ve been looking for a while for a solid solution to easily connect Gravity Forms to Salesforce. There have been lots of them in the past, but makers of Salesforce addons seem to enjoy making them premium over time, and Salesforce has also changed its API a couple of times in the past, breaking some of the free ones.

CRM Perks makes a premium plugin that’s pretty good, but I ran into a use case it didn’t account for the other day: dynamically adding a Salesforce Campaign ID on a per-page basis. So I needed to find something new.

I turned to Gravity Forms’ awesome Webhooks addon (please note that you do need a Gravity Forms Elite license to use this, but that’s pretty typical for full-time WordPress people to have, and I’ve had one for years).

The Webhooks addon essentially is able to do GET or POST requests with your form data, and it allows you to customize those requests with data from the form.

Set up your form

First, get your form set up. For our purposes here, we’re going to set up a basic form with first name, last name, email, and company name:

Gravity forms builder
The Gravity forms builder

That’s actually all we need to do there for now.

Generate a Salesforce Web-to-Lead form

Log into your Salesforce account, click into Setup (a little gear near the top right), then type “Web-to-Lead” in the search form. You have to have the dashes, and you have to be in Setup, because Salesforce nothing is ever intuitive.

Web-to-lead

One you’re there, go ahead and generate the web-to-lead form. It should look something like this:

Integrate Gravity forms with Salesforce

In the Gravity form you created, to go Settings > Webhooks, and create a new feed. It should look something like this:

We’re going to be using a POST request, and we want it formatted as a form, so do that. We also want control over the request body, to toggle “all fields” to be “select fields” instead.

Here’s how to configure it:

  • The Request URL is the form action from your web-to-lead form (stop copying when you see the ? sign). For this form, it’s https://webto.salesforce.com/servlet/servlet.WebToLead
  • Request Method is POST
  • Request Format is FORM
  • The field values should each be copied over from the Salesforce web-to-lead form.
  • Make sure to grab the oid, as that refers to the organization ID, and without it nothing will come into your account (don’t use the one shown here, as that’s my organization ID for my Salesforce account).

Here’s the completed feed:

Test a submission

Go embed the form on a page and test it. To see whether your data is flowing into Salesforce correctly, you’ll want to click into Leads in Salesforce, then look for the most recent leads that have come in.

That’s it!

It’s really pretty simple, but I wasn’t able to find any sort of guide to setting this up in a couple of searches, so I thought I’d write it up.

Reader Interactions

Comments

  1. Vid says

    February 5, 2020 at 5:54 pm

    Thanks Jon, its helpful. In my web to lead form, I also have these items –

    Country of Interest:–None–Australia
    New Zealand

    Subscribe to Mailing List:

    How to eneter these in webhooks feed?
    Thanks.

    Reply
    • Vid says

      February 5, 2020 at 5:57 pm

      input id=”lead_source” name=”lead_source” type=”hidden” value=”Web” /
      input id=”00N2v00000Sxl0t” name=”00N2v00000Sxl0t” type=”hidden” value=”1″ /
      input id=”00N2v00000Sxl0u” name=”00N2v00000Sxl0u” type=”hidden” value=”Join The Club” /
      input id=”00N2v00000UK6vZ” name=”00N2v00000UK6vZ” type=”hidden” value=”1″ /
      input type=”hidden” name=”Campaign_ID” value=”7012v000002BkPj” /
      input type=”hidden” name=”member_status” value=”Added” /

      Country of Interest:select id=”00N2v00000Sxl0v” name=”00N2v00000Sxl0v” title=”Country of Interest”option value=””–None–/optionoption value=”Australia”Australia/option
      option value=”New Zealand”New Zealand/option
      /selectbr

      Reply
    • Jon Schroeder says

      February 6, 2020 at 2:12 pm

      So, it should actually work in pretty much the same way as the other fields. What you’ll do is 1) figure out the names of these fields **as they appear in salesforce** 2) in the view like the screenshot above, you’ll enter the salesforce names of the fields in the columns on the left, then 3) match them up with the Gravity Forms values in the column on the right.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

About the blog

I’ve always been exceptionally bad at actually sitting down and writing blog entries, so do me a favor – please feel free to comment or drop me a line if you have something you’d like me to write about (or just to say hello).

Browse by category

  • Advanced Custom Fields
  • Gutenberg
  • Perspective
  • Tutorials & how-to guides
  • Updates

Centered and full-justified text on the internet

How to add contextual styling in the Gutenberg editor

User interface is really important

Reviewing SpinupWP and why I closed my account

VEEHAUS scam: a new scam targeting designers

Ready to get started?

There’s no pressure. If you’re interested in building a site, please feel free to reach out – and I’ll talk through your project with you and give you some pointers even if we don’t end up working together.

Reach out

Elodin Design, Inc. (formerly Red Blue Concepts)
Website design & development · Custom WordPress theme and plugin development
3305 Fox Hollow Circle, Waco, TX 76708 · (254) 340-0086
Copyright © 2023 · All rights reserved.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT