<?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: Adding two values in user notification shortcode</title>
		<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode</link>
		<description>Gravity Support Forums Topic: Adding two values in user notification shortcode</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 14:14:12 +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/adding-two-values-in-user-notification-shortcode" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66548</link>
			<pubDate>Mon, 16 Jul 2012 17:29:47 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">66548@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Glad to hear it, and thanks for posting your code. I am sure it will help others.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Schrock on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66524</link>
			<pubDate>Mon, 16 Jul 2012 16:08:08 +0000</pubDate>
			<dc:creator>Schrock</dc:creator>
			<guid isPermaLink="false">66524@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Worked perfectly...thanks!&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission&#38;quot;, &#38;quot;pre_submission_handler&#38;quot;);
function pre_submission_handler($form){
    $married = $_POST[&#38;quot;input_55&#38;quot;];
	$kids    = $_POST[&#38;quot;input_19&#38;quot;];

    //Hidden Field
    $_POST[&#38;quot;input_57&#38;quot;] = $married + $kids;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;The notification conditional statement&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[gravityforms action=&#38;quot;conditional&#38;quot; merge_tag=&#38;quot;{means total:57}&#38;quot; condition=&#38;quot;is&#38;quot; value=&#38;quot;3&#38;quot;]
Married with one kid
[/gravityforms]&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66462</link>
			<pubDate>Mon, 16 Jul 2012 11:24:13 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">66462@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Check out our documentation here:&#60;br /&#62;
&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_pre_submission&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;So you would want to grab the values from two form fields, add them together, and assign them to a third hidden field that you would then test again in your conditional shortcode in your notifications.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Schrock on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66460</link>
			<pubDate>Mon, 16 Jul 2012 11:22:38 +0000</pubDate>
			<dc:creator>Schrock</dc:creator>
			<guid isPermaLink="false">66460@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks.  Any code examples available using the presubmission_hook?  Chances are I'll have to hire someone to set that up but would like to give it a whirl first.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Peralty on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66396</link>
			<pubDate>Mon, 16 Jul 2012 08:00:54 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">66396@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Unfortunately, conditional logic doesn't allow those kinds of things yet. You would have to create hidden fields in your form, and then using the gform_pre_submission hook, you would have to write a function to do the logic, put a value in your hidden field, and then use conditional logic to pick up on that.&#60;/p&#62;
&#60;p&#62;So for your example, you would have a hidden field called &#34;lifestatus&#34;. &#60;/p&#62;
&#60;p&#62;Your pre_submission hook would grab the submitted values from your two fields, do the math, and send the value back to the lifestatus field.&#60;/p&#62;
&#60;p&#62;Then your conditional logic in your notifications would be able to do the is 3 conditional to show Married with one kid.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Schrock on "Adding two values in user notification shortcode"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/adding-two-values-in-user-notification-shortcode#post-66265</link>
			<pubDate>Sat, 14 Jul 2012 16:13:54 +0000</pubDate>
			<dc:creator>Schrock</dc:creator>
			<guid isPermaLink="false">66265@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have multiple instances where I need to add the value of two fields and then apply conditional logic to that value in my user notification, see below:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[gravityforms action=&#38;quot;conditional&#38;quot; merge_tag=&#38;quot;{Are You Married?:55} + {How many children reside with you?:19}&#38;quot; condition=&#38;quot;is&#38;quot; value=&#38;quot;3&#38;quot;]
Married with one kid
[/gravityforms]&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;NOTE: The &#34;Are you married&#34; field is a dropdown.  If yes is selected, it returns a value of 2, no returns a value of 1&#60;/p&#62;
&#60;p&#62;The above didn't work...how can I make that happen?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
