Gravity Forms and Salesforce Integrations

Gravity forms are generally the WordPress plugins to create a contact form. It allows site owners to create and gather the information.


It forms a great combination to gather the information and add leads to Salesforce automatically. It helps making CRM more easy and simple. To set up it takes few minutes and provide you a way to collect information with much simplicity.  Gravity forms are much more interactive and provides you with easy way to add fields, making them mandatory, email etc. If you already don’t have this plugin installed then get it and make your work much easier.


We have several apps which does somthing similar on the context of getting your data drom a Web Form into Salesforce. Ex:-

  1. Web2Anything:-
  2. formyoula:-
  3. Sites Pages:- You will have to custom build the vfpage with form and make it a publicly accessible URL.

salesforce integration1INTEGRATION

To integrate your Gravity Forms with Salesforce follow the steps below:

  • Go to setup in your Salesforce Org. and type web-to-lead in Quick Find box.

               Generate new form.

  • The redirect URL should be the URL where you want your page to be redirected after the submission of the form.



  • Select the fields you require in your Gravity Form and save the HTML code generated through it.




  • Create your web-to-lead form as described above
  • Look for the Salesforce Add-on tab(Form<Settings) and select Integration Method as Web-to-Lead. Update Settings.


Sync Salesforce with Gravity Form

  • Create your Gravity Form in your WordPress Site.

               Add the fields you used while creating your web-to-lead form

Creaate Form

  • Save the form.
  • Click the Gravity Form’s name and lookup for the confirmation tab under the settings.
  • Select confirmation tab to redirect
  • Redirect URL should be the URL you got while generating the web-to-lead form.




  • The URL should not include the “?encoding=UTF-8” since Gravity form do it itself on start of the query string.
  • Check “Pass Field Data Via Query String”
  • Your screen should look like this:





note sf1NOTE:  If you are trying to work in your sandbox then do change the Redirect URL to instead of since web-to-lead form generates form working in Production.

  • Remember you removed “?encoding=UTF-8” from the redirect URL, now make this the first line of your Query String.
  • Start with your oid and retURL to process our Query string. Each value should use “&” in between.



  • Now it’s time to map your salesforce fields to that of the gravity form you created.
  • Build your query string in the following format:


  • You can take help from the dropdown list which show up all the fields in the Gravity form. Now you have to just map the field values you included in the web-to-lead form to that of the gravity form fields with each field followed by “&” except the last one.

note sf1NOTE: It’s the important part so be very careful.


  • Save Confirmation
  • Search for the Salesforce Web-to-lead tab beneath confirmation tab.
  • Here map all the lead fields to that of the Gravity form’s fields.




  • You can check your form by clicking on the Preview option and then embed this form in your website.
  • Fill all the fields and check for two things. One whether the page is getting redirected to correct page and the other that all fields are getting populated correctly to your Salesforce Lead Records.
  • CONGRATS!! You have integrated your WordPress site with Salesforce.

Author: AJ

Share This Post On

Submit a Comment

Your email address will not be published.

× How can I help you?