<?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: Can conditional logic be used with after_submission hook?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/can-conditional-logic-be-used-with-after_submission-hook</link>
		<description>Gravity Support Forums Topic: Can conditional logic be used with after_submission hook?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:27:51 +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/can-conditional-logic-be-used-with-after_submission-hook" rel="self" type="application/rss+xml" />

		<item>
			<title>Dana Cobb on "Can conditional logic be used with after_submission hook?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-conditional-logic-be-used-with-after_submission-hook#post-49762</link>
			<pubDate>Fri, 17 Feb 2012 19:09:24 +0000</pubDate>
			<dc:creator>Dana Cobb</dc:creator>
			<guid isPermaLink="false">49762@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, alanna,&#60;/p&#62;
&#60;p&#62;This can be done by adding conditional logic in the notification. In the &#34;Notification to Administrator&#34; section, you can select &#34;Routing&#34;. With Routing turned on you can setup conditions for your drop down, one for each of your selections you want to be sent as an email (u.achieve, u.direct, or u.select). For the drop down options you do not setup, an email will NOT be sent.&#60;/p&#62;
&#60;p&#62;Then you can use the &#34;gform_after_submission&#34; hook to handle the other drop down selections to send the data to a third party. You would use use this hook something like below:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;//add hook specific to form id = 45
add_filter(&#38;quot;gform_after_submission_45&#38;quot;,&#38;quot;send_to_third_party&#38;quot;,10,2);
function send_to_third_party($entry, $form)
{
	//checking the value for field 1
	if (rgar($entry, &#38;quot;input_1&#38;quot;) == &#38;quot;test1&#38;quot;)
	{
		//send data to third party
	}
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The second example in the documentation at &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#60;/a&#62; points you to how you would pass the data along to a third-party's URL.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alanna on "Can conditional logic be used with after_submission hook?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/can-conditional-logic-be-used-with-after_submission-hook#post-49550</link>
			<pubDate>Wed, 15 Feb 2012 19:44:22 +0000</pubDate>
			<dc:creator>alanna</dc:creator>
			<guid isPermaLink="false">49550@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I am trying to implement the after_submission hook so that the form data goes to a third party database. I started by adding this code to the functions.php file: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_after_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;Will that become the default location where all form data is sent?  What happens to the conditional logic / notification settings? &#60;/p&#62;
&#60;p&#62;I would like route some data to the third party database, but some by email instead - is that possible?  See form here (our site is in beta): &#60;a href=&#34;http://collegesource.com.s127827.gridserver.com/contact-us&#34; rel=&#34;nofollow&#34;&#62;http://collegesource.com.s127827.gridserver.com/contact-us&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;In the drop down menu, if &#34;u.achieve, u.direct, or u.select&#34; option is selected different questions/form fields appear and that data I want to route via email only, which is already in place.  &#60;/p&#62;
&#60;p&#62;I basically need help determining the hook to write &#38;amp; add to function.php file so that IF &#34;u.achieve, u.direct, or u.select&#34; selected send data to email listed in notifications settings ELSE use the after_submission hook to go to the third party DB.&#60;/p&#62;
&#60;p&#62;Does any of this make sense?  Clearly I'm not a programmer but I am working with ours here to try to send form data to our in-house CMS for most submissions, but the one selection I mentioned above would go to email instead. &#60;/p&#62;
&#60;p&#62;Any help or detailed documentation is appreciated!
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
