<?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: Populating Address field on pre_render</title>
		<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render</link>
		<description>Gravity Support Forums Topic: Populating Address field on pre_render</description>
		<language>en-US</language>
		<pubDate>Tue, 21 Apr 2026 17:32:14 +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/populating-address-field-on-pre_render" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Populating Address field on pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render#post-290520</link>
			<pubDate>Thu, 30 May 2013 19:59:24 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">290520@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Here was the dev recommendation:&#60;/p&#62;
&#60;blockquote&#62;&#60;p&#62;
Instead of using gform_pre_render to do this, you will want to use this hook instead: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name&#60;/a&#62; . The inputs for the address field do not store default data like you are trying to do. You will want to set your address field to allow dynamic population and enter parameter names like in this screen shot: &#60;a href=&#34;http://grab.by/mYfi&#34; rel=&#34;nofollow&#34;&#62;http://grab.by/mYfi&#60;/a&#62; . Then you use those parameter names with the gform_field_value hook.&#60;/p&#62;
&#60;p&#62;There is some really good documentation on dynamic population on this page which links to other examples: &#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Using_Dynamic_Population&#60;/a&#62; .&#60;/p&#62;
&#60;/blockquote&#62;</description>
		</item>
		<item>
			<title>acsnaterse on "Populating Address field on pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render#post-283320</link>
			<pubDate>Tue, 28 May 2013 09:58:07 +0000</pubDate>
			<dc:creator>acsnaterse</dc:creator>
			<guid isPermaLink="false">283320@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;That means a/the solution will not be posted here?&#60;/p&#62;
&#60;p&#62;I've solved it myself now by populating the $_GET array. That works, but, of course, is not ideal solution.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Rob Harrell on "Populating Address field on pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render#post-283292</link>
			<pubDate>Tue, 28 May 2013 09:40:59 +0000</pubDate>
			<dc:creator>Rob Harrell</dc:creator>
			<guid isPermaLink="false">283292@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Handling via priority support.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>acsnaterse on "Populating Address field on pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render#post-282747</link>
			<pubDate>Tue, 28 May 2013 05:50:03 +0000</pubDate>
			<dc:creator>acsnaterse</dc:creator>
			<guid isPermaLink="false">282747@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Somebody has a clue? I'm dealing with the same problem here.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>microweb on "Populating Address field on pre_render"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-address-field-on-pre_render#post-273475</link>
			<pubDate>Fri, 24 May 2013 11:47:31 +0000</pubDate>
			<dc:creator>microweb</dc:creator>
			<guid isPermaLink="false">273475@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm trying to populate an address field with the billing address information from the current user's data.  I do not know what I've done wrong.  Also, if I check the box in the form to allow for dynamic population, how do I set up the hooks to get the data I want? &#60;/p&#62;
&#60;p&#62;I've created the following code:&#60;br /&#62;
&#60;code&#62;add_action(&#38;quot;gform_pre_submission_2&#38;quot;, &#38;quot;mwn_gform_pre_submission_2&#38;quot;);&#60;/code&#62;&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function mwn_gform_pre_render_2($form){
	$current_user = wp_get_current_user();
	$user_data = get_user_meta($current_user-&#38;gt;ID );
  foreach($form[&#38;quot;fields&#38;quot;] as &#38;amp;$field)
  	switch($field[&#38;quot;id&#38;quot;]){
		case 27:
			foreach($field[&#38;quot;inputs&#38;quot;] as &#38;amp;$input) {
				switch($input[&#38;quot;id&#38;quot;]){
						case 27.1:
							$input[&#38;quot;value&#38;quot;] = $user_data[&#38;quot;billing_address_1&#38;quot;][0];
							break;
						case 27.2:
							$input[&#38;quot;value&#38;quot;] = $user_data[&#38;quot;billing_address_2&#38;quot;][0];
							break;
						case 27.3:
							$input[&#38;quot;value&#38;quot;] = $user_data[&#38;quot;billing_city&#38;quot;][0];
							break;
						case 27.4:
							$input[&#38;quot;value&#38;quot;] = $user_data[&#38;quot;billing_state&#38;quot;][0];
							break;
						case 27.5:
							$input[&#38;quot;value&#38;quot;] = $user_data[&#38;quot;billing_postcode&#38;quot;][0];
							break;
						default:
							break;
				}
			}
			break;
		default:
			break;
	}

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

	</channel>
</rss>
