<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.1" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Gravity Support Forums Topic: gform after submission - works with multiple forms?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms</link>
		<description>Gravity Support Forums Topic: gform after submission - works with multiple forms?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 01:13:40 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.1</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>https://legacy.forums.gravityhelp.com/search.php</link>
		</textInput>
		<atom:link href="https://legacy.forums.gravityhelp.com/rss/topic/gform-after-submission-based-on-different-forms" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-78958</link>
			<pubDate>Thu, 04 Oct 2012 16:33:07 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">78958@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;No problem. Glad it helped.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>loxllxol on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-78956</link>
			<pubDate>Thu, 04 Oct 2012 16:26:35 +0000</pubDate>
			<dc:creator>loxllxol</dc:creator>
			<guid isPermaLink="false">78956@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;^^^ YUP! That fixed it...thanks!!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73316</link>
			<pubDate>Thu, 30 Aug 2012 14:36:45 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">73316@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can't name both of your functions the same. Try having post_to_third_party and post_to_internal or something.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>loxllxol on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73310</link>
			<pubDate>Thu, 30 Aug 2012 14:15:02 +0000</pubDate>
			<dc:creator>loxllxol</dc:creator>
			<guid isPermaLink="false">73310@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Chris, I updated functions.php with the following code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Post Form 1 MAIN FORM to SAGE CRM
add_action(&#38;#39;gform_after_submission_1&#38;#39;, &#38;#39;post_to_third_party&#38;#39;, 10, 2);
function post_to_third_party($entry, $form) {

    $post_url = &#38;#39;http://sage.cpssecurity.com/cpssage/eware.dll/SubmitLead?RuleID=&#38;#39;;
    $body = array(
        &#38;#39;lead_personfirstname&#38;#39; =&#38;gt; $entry[&#38;#39;1.3&#38;#39;],
        &#38;#39;lead_personlastname&#38;#39; =&#38;gt; $entry[&#38;#39;1.6&#38;#39;],
        &#38;#39;lead_companyname&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_description&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_personemail&#38;#39; =&#38;gt; $entry[&#38;#39;3&#38;#39;],
		&#38;#39;lead_personphonenumber&#38;#39; =&#38;gt; $entry[&#38;#39;4&#38;#39;],
		&#38;#39;lead_servicetype&#38;#39; =&#38;gt; $entry[&#38;#39;10&#38;#39;],
		&#38;#39;lead_cprojvalue&#38;#39; =&#38;gt; $entry[&#38;#39;11&#38;#39;],
		&#38;#39;lead_details&#38;#39; =&#38;gt; $entry[&#38;#39;5&#38;#39;],
		&#38;#39;lead_decisiontimeframe&#38;#39; =&#38;gt; $entry[&#38;#39;16&#38;#39;],
		&#38;#39;lead_subid&#38;#39; =&#38;gt; $entry[&#38;#39;12&#38;#39;],
		&#38;#39;lead_campaign&#38;#39; =&#38;gt; $entry[&#38;#39;13&#38;#39;],
		&#38;#39;lead_source&#38;#39; =&#38;gt; $entry[&#38;#39;14&#38;#39;],
		&#38;#39;lead_companystate&#38;#39; =&#38;gt; $entry[&#38;#39;15&#38;#39;]
        );

    $request = new WP_Http();
    $response = $request-&#38;gt;post($post_url, array(&#38;#39;body&#38;#39; =&#38;gt; $body));

}
// Post Form 1 INTERNAL SALES to SAGE CRM
add_action(&#38;#39;gform_after_submission_2&#38;#39;, &#38;#39;post_to_third_party&#38;#39;, 10, 2);
function post_to_third_party($entry, $form) {

    $post_url = &#38;#39;http://sage.cpssecurity.com/cpssage/eware.dll/SubmitLead?RuleID=&#38;#39;;
    $body = array(
        &#38;#39;lead_personfirstname&#38;#39; =&#38;gt; $entry[&#38;#39;1.3&#38;#39;],
        &#38;#39;lead_personlastname&#38;#39; =&#38;gt; $entry[&#38;#39;1.6&#38;#39;],
        &#38;#39;lead_companyname&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_description&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_personemail&#38;#39; =&#38;gt; $entry[&#38;#39;3&#38;#39;],
		&#38;#39;lead_personphonenumber&#38;#39; =&#38;gt; $entry[&#38;#39;4&#38;#39;],
		&#38;#39;lead_servicetype&#38;#39; =&#38;gt; $entry[&#38;#39;10&#38;#39;],
		&#38;#39;lead_cprojvalue&#38;#39; =&#38;gt; $entry[&#38;#39;11&#38;#39;],
		&#38;#39;lead_details&#38;#39; =&#38;gt; $entry[&#38;#39;5&#38;#39;],
		&#38;#39;lead_decisiontimeframe&#38;#39; =&#38;gt; $entry[&#38;#39;16&#38;#39;],
		&#38;#39;lead_subid&#38;#39; =&#38;gt; $entry[&#38;#39;18&#38;#39;],
		&#38;#39;lead_campaign&#38;#39; =&#38;gt; $entry[&#38;#39;13&#38;#39;],
		&#38;#39;lead_source&#38;#39; =&#38;gt; $entry[&#38;#39;14&#38;#39;],
		&#38;#39;lead_companystate&#38;#39; =&#38;gt; $entry[&#38;#39;15&#38;#39;]
        );

    $request = new WP_Http();
    $response = $request-&#38;gt;post($post_url, array(&#38;#39;body&#38;#39; =&#38;gt; $body));

}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However, when I include the 2nd gform_after_submission_2, my wordpress loads a blank page.  When I remove the 2nd gform_after_submission_2 code, the wordpress install loads fine.&#60;/p&#62;
&#60;p&#62;Any ideas?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73232</link>
			<pubDate>Thu, 30 Aug 2012 07:12:01 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">73232@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You're welcome.  Most filters and hooks in Gravity Forms work that way.  When they do not, we have a work around for you to process the code only for specific forms.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>loxllxol on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73201</link>
			<pubDate>Wed, 29 Aug 2012 22:09:49 +0000</pubDate>
			<dc:creator>loxllxol</dc:creator>
			<guid isPermaLink="false">73201@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You're the man!!  Totally solves my problem...thanks!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73192</link>
			<pubDate>Wed, 29 Aug 2012 20:52:31 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">73192@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Take a look at the &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#34; rel=&#34;nofollow&#34;&#62;documentation&#60;/a&#62;.  You can add a form ID to the hook, like this&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;gform_after_submission_4&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;where 4 is your form ID.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>loxllxol on "gform after submission - works with multiple forms?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/gform-after-submission-based-on-different-forms#post-73181</link>
			<pubDate>Wed, 29 Aug 2012 20:15:19 +0000</pubDate>
			<dc:creator>loxllxol</dc:creator>
			<guid isPermaLink="false">73181@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is there a way to specify which &#34;gform after submission hook&#34; to perform based on which form is used?&#60;/p&#62;
&#60;p&#62;For example:  &#60;/p&#62;
&#60;p&#62;Form A &#38;gt; Submits to URL A&#60;br /&#62;
Form B &#38;gt; Submits to URL B&#60;/p&#62;
&#60;p&#62;The problem I am running into, is that gform after submission hook submits the same values no matter what form is used.  This is a problem because different forms have different $entry numbers and values.&#60;/p&#62;
&#60;p&#62;($entry 1 may be the first name on Form A, but may be an email address on Form B).&#60;/p&#62;
&#60;p&#62;Here is my gform after submission (which works perfectly BTW, when only using ONE FORM.  The problem starts when I create multiple gravity forms).&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// Post to SAGE CRM
add_action(&#38;#39;gform_after_submission&#38;#39;, &#38;#39;post_to_third_party&#38;#39;, 10, 2);
function post_to_third_party($entry, $form) {

    $post_url = &#38;#39;http://sage.cpssecurity.com/cpssage/eware.dll/SubmitLead?RuleID=&#38;#39;;
    $body = array(
        &#38;#39;lead_personfirstname&#38;#39; =&#38;gt; $entry[&#38;#39;1.3&#38;#39;],
        &#38;#39;lead_personlastname&#38;#39; =&#38;gt; $entry[&#38;#39;1.6&#38;#39;],
        &#38;#39;lead_companyname&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_description&#38;#39; =&#38;gt; $entry[&#38;#39;2&#38;#39;],
		&#38;#39;lead_personemail&#38;#39; =&#38;gt; $entry[&#38;#39;3&#38;#39;],
		&#38;#39;lead_personphonenumber&#38;#39; =&#38;gt; $entry[&#38;#39;4&#38;#39;],
		&#38;#39;lead_servicetype&#38;#39; =&#38;gt; $entry[&#38;#39;10&#38;#39;],
		&#38;#39;lead_cprojvalue&#38;#39; =&#38;gt; $entry[&#38;#39;11&#38;#39;],
		&#38;#39;lead_details&#38;#39; =&#38;gt; $entry[&#38;#39;5&#38;#39;],
		&#38;#39;lead_decisiontimeframe&#38;#39; =&#38;gt; $entry[&#38;#39;16&#38;#39;],
		&#38;#39;lead_subid&#38;#39; =&#38;gt; $entry[&#38;#39;12&#38;#39;],
		&#38;#39;lead_campaign&#38;#39; =&#38;gt; $entry[&#38;#39;13&#38;#39;],
		&#38;#39;lead_source&#38;#39; =&#38;gt; $entry[&#38;#39;14&#38;#39;],
		&#38;#39;lead_companystate&#38;#39; =&#38;gt; $entry[&#38;#39;15&#38;#39;]
        );

    $request = new WP_Http();
    $response = $request-&#38;gt;post($post_url, array(&#38;#39;body&#38;#39; =&#38;gt; $body));

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
