<?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: correct syntax to populate fields dynamically?</title>
		<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically</link>
		<description>Gravity Support Forums Topic: correct syntax to populate fields dynamically?</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 03:45:06 +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/correct-syntax-to-populate-fields-dynamically" rel="self" type="application/rss+xml" />

		<item>
			<title>Erwin van den Boogaard on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3324</link>
			<pubDate>Thu, 11 Feb 2010 20:29:27 +0000</pubDate>
			<dc:creator>Erwin van den Boogaard</dc:creator>
			<guid isPermaLink="false">3324@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Carl.&#60;/p&#62;
&#60;p&#62;For readers wondering which thread here's the link:&#60;br /&#62;
&#60;a href=&#34;http://forum.gravityhelp.com/topic/drop-down-value-different-than-content-text&#34; rel=&#34;nofollow&#34;&#62;http://forum.gravityhelp.com/topic/drop-down-value-different-than-content-text&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3303</link>
			<pubDate>Thu, 11 Feb 2010 14:42:23 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3303@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey Erwin, I responded in your other thread...
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Erwin van den Boogaard on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3256</link>
			<pubDate>Tue, 09 Feb 2010 20:04:59 +0000</pubDate>
			<dc:creator>Erwin van den Boogaard</dc:creator>
			<guid isPermaLink="false">3256@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thanks Carl. I have it working.&#60;br /&#62;
Next step was to fill drop downs with custom values. I have that working too thanks to Jan Egbert's post.&#60;br /&#62;
Last step is combining the two; how can I preselect a dynamic value in a drop down that's build dynamically?&#60;br /&#62;
For example: user record shows NL as country, so the drop down should show &#34;Netherlands&#34;.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Erwin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3212</link>
			<pubDate>Mon, 08 Feb 2010 11:46:58 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3212@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can't use a short code within a short code or a function call within a short code.&#60;/p&#62;
&#60;p&#62;What you will have to do is use PHP and an available hook to pre-populate the fields via your session data. This will be accomplished by placing a snippet of code in your themes function.php file that pre-populates the field.&#60;/p&#62;
&#60;p&#62;- edit the field you want to pre-populate in the Form editor&#60;/p&#62;
&#60;p&#62;- select the advanced tab&#60;/p&#62;
&#60;p&#62;- check the &#34;Allow field to be populated dynamically&#34; checkbox&#60;/p&#62;
&#60;p&#62;- give the dynamic field a Parameter Name (ex. city). This parameter name is what will be used in the querystring to pass the value.&#60;/p&#62;
&#60;p&#62;- save your form&#60;/p&#62;
&#60;p&#62;- edit your themes function.php file&#60;/p&#62;
&#60;p&#62;- place this code snippet into your function.php file&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_city&#38;quot;, &#38;quot;populate_city&#38;quot;);
function populate_city(){
$city_value = &#38;quot;Test&#38;quot;;
return $city_value;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Now the example above is based on populating a field with the parameter name &#34;city&#34; with the value of &#34;Seattle&#34;.  Notice everywhere &#34;city&#34; appears.  This would be replaced with the parameter name for your field (ex. firstname, etc.).  You can then set the value to whatever you want (session, etc.).&#60;/p&#62;
&#60;p&#62;In your situation you would give each of the fields you want to populate a parameter name (ex. firstname, lastname, etc.) and then add the above filter for each of these fields to your themes function.php file... changing it each time to target the appropriate parameter name.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Erwin van den Boogaard on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3202</link>
			<pubDate>Sun, 07 Feb 2010 13:36:09 +0000</pubDate>
			<dc:creator>Erwin van den Boogaard</dc:creator>
			<guid isPermaLink="false">3202@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Carl,&#60;/p&#62;
&#60;p&#62;Thanks for getting back to me so quick.&#60;/p&#62;
&#60;p&#62;What I'm trying to achieve is a connection between another WP plugin that gets its data from aMember. That plugin allows me to use shortcuts to display the aMember user data. I can of course also get the data via sessions variables in PHP.&#60;br /&#62;
But I just can't seem this data to prefill the Gravity Form fields.&#60;/p&#62;
&#60;p&#62;For example: the user's address, city, country.&#60;br /&#62;
I can display those in a WP post by using [country] or by executing (of course in combination with the Exec-PHP plugin)  &#38;lt;?php echo $_SESSION['_amember_user'][country]; ?&#38;gt;'] &#60;/p&#62;
&#60;p&#62;I've tried by using the Gravity Forms shortcuts:&#60;br /&#62;
[gravityform id=1 field_values=&#34;country= &#38;lt;?php echo $_SESSION['_amember_user'][country]; ?&#38;gt;&#34;]&#60;br /&#62;
and&#60;br /&#62;
[gravityform id=1 field_values=&#34;country= [country]&#34;]&#60;/p&#62;
&#60;p&#62;I also tried by submitting the info via a form and requesting it like {country}&#60;br /&#62;
but that didn't work either.&#60;/p&#62;
&#60;p&#62;What am I doing wrong here?&#60;/p&#62;
&#60;p&#62;regards,&#60;br /&#62;
Erwin
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3199</link>
			<pubDate>Sun, 07 Feb 2010 12:23:49 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">3199@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Fields can be dynamically populated 3 different ways.&#60;/p&#62;
&#60;p&#62;- Via query string (ex. domain.com/your/form?firstname=carl)&#60;/p&#62;
&#60;p&#62;- Via hooks using PHP&#60;/p&#62;
&#60;p&#62;- Via short code&#60;/p&#62;
&#60;p&#62;Populating fields via a short code happens when you insert a form into a post or page using the short code.  For example:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;[gravityform id=xxx field_values=&#38;#39;field_name=value&#38;#39;]&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I'm not sure what exactly you are trying to do.  If you are placing short codes in the &#34;Parameter&#34; field in the field settings where you have checked to &#34;Allow field to be populated dynamically&#34; than this is incorrect.&#60;/p&#62;
&#60;p&#62;The parameter field under &#34;Allow field to be populated dynamically&#34; is for you to name that individual field using a variable that you then can target via the query string, PHP via api hooks or when you insert a form with a short code.&#60;/p&#62;
&#60;p&#62;If you tell me a little bit about what you are trying to do we can tell you the best method to use.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Erwin van den Boogaard on "correct syntax to populate fields dynamically?"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/correct-syntax-to-populate-fields-dynamically#post-3198</link>
			<pubDate>Sun, 07 Feb 2010 06:51:15 +0000</pubDate>
			<dc:creator>Erwin van den Boogaard</dc:creator>
			<guid isPermaLink="false">3198@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi guys,&#60;/p&#62;
&#60;p&#62;In the tooltip of 'Allow field to be populated dynamically (?)'&#60;br /&#62;
I read: &#34;Check this option to enable data to be passed to the form and pre-populate this field dynamically. Data can be passed via Query Strings, Shortcode and/or Hooks&#34;&#60;/p&#62;
&#60;p&#62;This is why I purchased Gravity Forms yesterday; pre-populate with shortcodes&#60;/p&#62;
&#60;p&#62;So I used for the advanced field 'Name' I the following parameters:&#60;br /&#62;
First	: [name_f]&#60;br /&#62;
Last: [name_l]&#60;/p&#62;
&#60;p&#62;But unfortunately when I check the form on the page the fields are empty...&#60;br /&#62;
Am I using the correct syntax or do I have to use a different format to request the data via shortcodes?&#60;/p&#62;
&#60;p&#62;I look forward to your reply.&#60;/p&#62;
&#60;p&#62;Regards,&#60;br /&#62;
Erwin
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
