Plugin Directory

Test out the new Plugin Directory and let us know what you think.

Gravity Forms Salesforce Add-on

This is the most powerful Salesforce integration available for WordPress.

Web-to-Lead: DateTime fields don't process

This is a known issue. We've tried everything to get this working, but Salesforce won't accept any submitted DateTime formats.

Here's how to enable the functionality. If you find a solution, let us know on that page.

Web-to-Lead: I'm not seeing any errors, but the entry didn't get added to Salesforce!

Please check the box "Enable Salesforce debugging emails" in the Web-to-Lead settings page. Salesforce will send you an email with a reason the lead or case wasn't added.

Web-to-Lead: How do I convert my existing form configuration to Feeds?

See "Web-to-Lead: How do I create a Feed" below.

API: How do I create a Feed?

  • Go to the plugin settings page (under Forms > Settings > Salesforce Add-on )
  • Choose your Integration Method (API or Web-to-Lead)
  • Select API as your Integration Method
  • Click Save Settings.
  • Click the "Salesforce: API" menu in the current settings
  • Click the "Login with Salesforce" button
  • Log in to Salesforce.com
  • Click on the Forms > Salesforce menu link to create a feed
  • Follow the steps to create a feed

Web-to-Lead: How do I create a Feed?

To create a feed:

  • Go to the plugin settings page (under Forms > Settings > Salesforce Add-on )
  • Select Web-to-Lead as your Integration Method
  • Click Save Settings
  • Go to the Gravity Forms Forms page (the Forms menu)
  • Edit the form you want to connect with Salesforce
  • On the Edit Form page, under "Form Settings", click the "Salesforce: Web-to-Lead" link
  • Click the link to create a feed

Web-to-Lead: How do I modify the debug email address?

The Salesforce debugging emails are sent to the website administrator by default. To modify this, add a filter to gf_salesforce_salesforce_debug_email_address that returns an email address.

Web-to-Lead: How do I add an entry to a Campaign?

To associate a Web-to-Lead with a Campaign, you must also set the "Member Status". Read the Salesforce help article

  • Add two fields to your form:
    1. "Campaign ID" - The "Campaign ID" form field will be a hidden field. Add a hidden field, click the "Advanced" tab, and add the ID of the Campaign you want to add the entry to (it will look something like 902A0000000aBC1). For Advanced Users: Alternately, you can make this form a Radio Button field with different Campaign IDs values for different options.
    2. "Member Status" - Your campaign has different statuses for campaign members, such as "Sent" and "Responded". You can either create a hidden field with a pre-determined value, or a Radio Button field with different status options. The values should match up with your Salesforce Campaign Status options.
  • Save the form
  • Go to Form Settings > Salesforce: Web-to-Lead
  • Create a Feed or edit an existing Feed (see "Web-to-Lead: How do I create a Feed?" above for more information)
  • Find the "Campaign ID" row and select the Campaign ID field you just created
  • Find the "Member Status" row and select the Status field you just created
  • Save/Update the Feed.
  • There you go!

Web-to-Lead: My input values are being cut off in Salesforce

If you are submitting to a "Multi PickList" field in Salesforce, the values need to be separated with ';' instead of ','. Add a filter to your functions.php file:

add_filter('gf_salesforce_implode_glue', 'change_salesforce_implode_glue');

 * Change the way the data is submitted to salesforce to force submission as multi picklist values.
 * @param  string $glue  ',' or ';'
 * @param  array $field The field to modify the glue for
 * @return string        ',' or ';'
function change_salesforce_implode_glue($glue, $field) {

    // Change this to the Salesforce API Name of the field that's not being passed properly.
    $name_of_sf_field = 'ExampleMultiSelectPicklist__c';

    // If the field being checked is the Salesforce field that is being truncated, return ';'
    if($field['inputName'] === $name_of_sf_field || $field['adminLabel'] === $name_of_sf_field) {
        return ';';

    // Otherwise, return default.
    return $glue;

How do I modify the Soap, Proxy, WSDL and connection settings?

  • gf_salesforce_wsdl - Path to the WSDL (string)
  • gf_salesforce_proxy - Proxy settings as an object with properties host, port (integer, not a string), login and password (object, ideally a ProxySettings object)
  • gf_salesforce_soap_options Additional options to send to the SoapClient constructor. (array) See http://php.net/manual/en/soapclient.soapclient.php
  • gf_salesforce_connection - Modify the SforcePartnerClient object before it's returned.

See the FAQ item above for an example of using a filter.

Do I need both plugins activated?

No, you only need one, and the API plugin is recommended: the Web-to-Lead plugin is no longer being actively developed. If you are using Web-to-Lead, you don't need the API plugin activated. If you are using the API plugin, you don't need the Web-to-Lead activated.

What are the server requirements?

Your server must support the following:

  • PHP 5.x
  • SOAP Enabled
  • SSL Enabled
  • cURL Enabled
  • OpenSSL Enabled

I have Salesforce Enterprise Edition, not Partner Edition

Add the following to the bottom of your theme's functions.php file, before ?>, if it exists:

add_filter('gf_salesforce_enterprise', '__return_true');

How do I set a custom Lead Source? (Web-to-Lead)

This feature support was added in version 1.1.1. gf_salesforce_lead_source is the filter.

Add the following to your theme's functions.php file. Modify as you see fit:

add_filter('gf_salesforce_lead_source', 'make_my_own_lead_source', 1, 3);

function make_my_own_lead_source($lead_source, $form_meta, $data) {
    // $lead_source - What was about to be used (normally Gravity Forms Form Title)
    // $form_meta - Gravity Forms form details
    // $data - The data passed to Salesforce

    return $lead_source; // Return something else if you want to.

My Assignment Rule is not triggered. How do I fix this?

add_action('gf_salesforce_connection', 'gf_salesforce_set_default_assignement_rule');

function gf_salesforce_set_default_assignement_rule($client) {
    //  Two Options for Setting Assignment Rule
    //    1.  Pass in AssignmentRule ID and "false" to use a specific assignment rule.
    //    2.  Pass in null and true to trigger the DEFAULT AssignementRule
    $header = new \AssignmentRuleHeader(null, true);


    return $client;

Can I use Salesforce Custom Fields? (Web-to-Lead)

You can. When you are trying to map a custom field, you need to set either the "Admin Label" for the input (in the Advanced tab of each field in the Gravity Forms form editor) or the Parameter Name (in Advanced tab, visible after checking "Allow field to be populated dynamically") to be the API Name of the Custom Field as shown in Salesforce. For example, a Custom Field with a Field Label "Web Source" could have an API Name of SFGA__Web_Source__c.

You can find your Custom Fields under [Your Name] → Setup → Leads → Fields, then at the bottom of the page, there's a list of "Lead Custom Fields & Relationships". This is where you will find the "API Name" to use in the Admin Label or Parameter Name.

If that doesn't work If the fields are not submitting properly still, you may need to try a different approach: under "Lead Custom Fields & Relationships", click on the name of the field. The URL of the page you go to will be formatted like this: https://na123.salesforce.com/12AB0000003CDe4?setupid=LeadFields. You want to copy the part of the URL that looks similar to 12AB0000003CDe4. Use that value instead of the API Name.

I need to send a "Date/Time" field, not a "Date" field. How do I do that? (Web-to-Lead)

Salesforce makes this a little difficult, sorry!

You need to add the following to your theme's functions.php file:

add_filter('gf_salesforce_use_datetime', 'filter_the_gf_salesforce_datetime', 10, 3);

 * Modify whether to use Date/Time format instead of Date based on the field key.
 * @param  boolean $use_datetime Whether to use Date/Time.
 * @param  string  $key          Key of field.
 * @param  array   $vars         Array of relevant data: 'form', 'entry', 'field', 'feed'
 * @return boolean               True: Use "Date/Time" format; False: use "Date" format
function filter_the_gf_salesforce_datetime($use_datetime = false, $key = '', $vars = array()) {

    // CHANGE THE NAME BELOW to the field name you want to use Date/Time for!
    if($key === 'MY__Custom_DateTime_Key') { return true; }

    // If it's not a match, use default (Date)
    return $use_datetime;

If that doesn't work, you can modify the format for the date by using this code:

add_filter('gf_salesforce_format_date', 'modify_gf_salesforce_format_date');

 * The default is US-style,  though Salesforce recommends Y-m-d\'\T\'H:i:s
 * You can use any date formatting as shown here:
 * @link  http://php.net/manual/en/function.date.php
function modify_gf_salesforce_format_date($previous = '') {
    $date_format = 'Y-m-d\'\T\'H:i:s';
    return $date_format;

I know I have SOAP enabled and the API plugin says I don't.

Add this to the bottom of your theme's functions.php file to force loading even if a SOAPClient class does not exist:

add_filter( 'gf_salesforce_soap_is_available', '__return_true');

Checkboxes aren't being passing to Salesforce

Make the value of checkboxes 1 in Gravity Forms. See how to do that here.

What's the license for this plugin?

This plugin is released under a GPL license.

Requires: 3.3 or higher
Compatible up to: 4.2.11
Last Updated: 2 years ago
Active Installs: 7,000+


4.4 out of 5 stars


0 of 19 support threads in the last two months have been marked resolved.

Got something to say? Need help?


Not enough data

0 people say it works.
0 people say it's broken.

100,1,1 100,2,2 50,6,3 50,2,1
100,1,1 0,2,0 100,1,1
50,2,1 100,1,1
50,2,1 100,1,1
0,1,0 100,1,1
0,1,0 0,1,0 0,1,0