PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Add Salesforce OID to GF form as hidden field

  1. Anonymous
    Unregistered

    I would like to add this string to my form tag in GF.

    <input type="hidden" name="sfga" value="XXXXXXXXXXXXXXXX"/>

    How do i do it in GF using hidden fields. I tried with HTML but it gives blank page & wouldnt parse the fields to Salesforce.

    Paul

    Posted 13 years ago on Thursday March 31, 2011 | Permalink
  2. What exactly are you trying to do? You can't add static markup to the forms like this, they are dynamic. If you explain what you are trying to do in more detail we may be able to provide alternative solutions.

    Posted 13 years ago on Thursday March 31, 2011 | Permalink
  3. I too am looking for a solution to this.

    Basically, client wants to integrate the form with SaleForce's web-to-lead. It's pretty basic but will require me to add the following to the Gravity Form.

    <form action="https://www.salesforce.com/servlet/servlet.WebToLead?
    encoding=UTF-8" method="POST">

    <input type=hidden name="oid" value="XXXXXXXXXXXXXX">
    <input type=hidden name="retURL" value="http://">

    Obviously, I hid the value..

    What is the best way to do this?

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  4. You can't change the form action of a Gravity Form, so you can't change the form action to point to SalesForce. Well, I say you can't... you can using a hook BUT once you change the form action, Gravity Forms no longer has control over the form and can't perform any kind of validation, etc. So it is possible, but not recommended.

    The proper way to integrate with a 3rd party service is via the use of hooks and custom PHP. You would use the gform_post_submission hook and write custom PHP so that when the form is submitted your code executes and integrates with the 3rd party service API or posts data to it then.

    Here is a forum post that discusses their usage:

    http://www.gravityhelp.com/forums/topic/sms-api-gateway-need-help-to-get-gform-to-integrate#post-18087

    Here is documentation on the gform_post_submission hook:

    http://www.gravityhelp.com/documentation/page/Gform_post_submission

    Here is documentation on the Entry object:

    http://www.gravityhelp.com/documentation/page/Entry_Object

    You would write custom code using these and place them in your themes functions.php file to execute them.

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  5. Thanks Carl for the quick response. I will dig into this.

    What about just adding the hidden fields? What's the best method there?

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  6. Fields can only be added the form using the form editor. So you'd have to add hidden fields to your form using the form editor and use the default values to populate them or use PHP and hooks to dynamically populate their values. You'd then have to use the gform_post_submission hook to post to SalesForce when the form is submitted.

    Posted 13 years ago on Friday April 22, 2011 | Permalink
  7. Yeah.. I got that. I am trying to do it via the redirect too..but I can't get the hidden fields to contain the right information.

    I add a Hidden Field in the form editor, but there is no real option to just add the HTML I need to in order to get:

    <input type=hidden name="oid" value="XXXXXXXXXXXXXX">
    <input type=hidden name="retURL" value="http://">

    Correctly coded when I view the source...

    What is the best options to choose via the Hidden field option within the form editor to get those tags formatted correctly as listed above?

    Posted 13 years ago on Saturday April 23, 2011 | Permalink
  8. I'm trying to find a solution for this as well.. but let's be clear, the issue is not with integrating Gravity Forms to SF -- INSTEAD, it's SalesForce & Google Adwords integration.

    Getting Gravity Forms to send data to SF is easy - either of these two links will help ::

    http://www.seobywebmechanix.com/wordpress-salesforce-integration-gravity-forms-web-to-lead
    &&
    http://wordpress.org/extend/plugins/gravity-forms-salesforce/

    BUT WHEN IT COMES TO "SFGA" (SalesForce Google Adwords) - we cannot complete the step by step guide because of 2 things:

    1 - Need to add hidden field <input type="hidden" name="sfga" value="xxxxxxxxxxxx"> -- can't do so w/ GF, but can do with custom jQuery

    2 - Even if you do #1 w/ jQuery, upon submitting the form, it hangs on https://lct.salesforce.com/sfga -- I THINK this is because the input names are not "first_name" etc.. instead are the GF "input_1" etc..

    Here is the SFGA JS code:
    https://lct.salesforce.com/sfga.js

    You are told to put this on your site:

    <!-- Begin Salesforce Tracking Code, Place immediately before closing </BODY> tag -->
    <SCRIPT type="text/javascript" src="https://lct.salesforce.com/sfga.js"></SCRIPT>
    <SCRIPT type="text/javascript">__sfga();</SCRIPT>
    <!-- End Salesforce Tracking Code, Place immediately before closing </BODY> tag -->

    If Gravity Forms got this working, a WHOLE NEW MARKET will open up!

    Posted 12 years ago on Monday January 16, 2012 | Permalink
  9. ggntt
    Member

    It it true ? We cannot use google adwords app for salesforce if we are using gravity forms to submit our lead capture data to SF?

    Thanks
    G

    Posted 12 years ago on Wednesday February 15, 2012 | Permalink