<?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 form with data from second database</title>
		<link>https://legacy.forums.gravityhelp.com/topic/populating-form-with-data-from-second-database</link>
		<description>Gravity Support Forums Topic: Populating form with data from second database</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 06:32:26 +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-form-with-data-from-second-database" rel="self" type="application/rss+xml" />

		<item>
			<title>David Smith on "Populating form with data from second database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-form-with-data-from-second-database#post-35795</link>
			<pubDate>Tue, 20 Sep 2011 18:06:39 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">35795@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi WizardGuy,&#60;/p&#62;
&#60;p&#62;Might be easier to add the filters dynamically using the gform_pre_render function. Here is some sample code:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://pastie.org/2565423&#34; rel=&#34;nofollow&#34;&#62;http://pastie.org/2565423&#60;/a&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>TheWizardGuy on "Populating form with data from second database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-form-with-data-from-second-database#post-35451</link>
			<pubDate>Thu, 15 Sep 2011 18:06:41 +0000</pubDate>
			<dc:creator>TheWizardGuy</dc:creator>
			<guid isPermaLink="false">35451@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So the steps are:&#60;/p&#62;
&#60;p&#62;1) Go to form design and check off &#34;Allow field to be populated dynamically&#34;.&#60;br /&#62;
2) Give the field a unique parameter name (unique for all forms). For example, if the field name is &#34;fname&#34; (first name) the parameter might be &#34;pfname&#34;.&#60;br /&#62;
3) Add a filter in functions.php&#60;br /&#62;
&#60;code&#62;add_filter(&#38;quot;gform_field_value_pfnam&#38;quot;, &#38;quot;populate_pfname&#38;quot;)&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;function populate_pfname($value)&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;return [some code here to figure out what the first name is]&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;}&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;4 And rinse and repeat 17 more times for the rest of the fields in the form, changing the parameter name and the function name each time. You have to &#34;hard code&#34; all of the parameter names and popluate_whatever functions.&#60;/p&#62;
&#60;p&#62;Is there some way to grab all 18 fields once, stuff 'em in an array and then pass the array along to the 18 add_fitler's?&#60;/p&#62;
&#60;p&#62;Not as confused, but still in Thornhill,&#60;/p&#62;
&#60;p&#62;Lawrence
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Carl Hancock on "Populating form with data from second database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-form-with-data-from-second-database#post-35440</link>
			<pubDate>Thu, 15 Sep 2011 17:17:30 +0000</pubDate>
			<dc:creator>Carl Hancock</dc:creator>
			<guid isPermaLink="false">35440@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;If you are trying to populate fields dynamically there is a tutorial on how to do so here:&#60;/p&#62;
&#60;p&#62;&#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;</description>
		</item>
		<item>
			<title>TheWizardGuy on "Populating form with data from second database"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-form-with-data-from-second-database#post-35436</link>
			<pubDate>Thu, 15 Sep 2011 16:57:47 +0000</pubDate>
			<dc:creator>TheWizardGuy</dc:creator>
			<guid isPermaLink="false">35436@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ihave successfully used the code in the discussion &#34;Grabbing $_POST to simulanteously store in a second database&#34; (&#60;a href=&#34;http://www.gravityhelp.com/forums/topic/filling-gform_field_value-with-values-using-post&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/forums/topic/filling-gform_field_value-with-values-using-post&#60;/a&#62;) to take user input into a form and create a row in an external MySQL table (thanks to all who participated--it works like a dream!)&#60;/p&#62;
&#60;p&#62;But now I have to go the other way--pull a row from that database and populate a Gravity Form so that association members can change their data (and then post it back..which just repeats the stuff in the paragraph above).&#60;/p&#62;
&#60;p&#62;I can query the database and retrieve the record just fine, but for the life of me I can't figure out the next step or which hook to use (gform_pre_render or gform_field_value.) &#60;/p&#62;
&#60;p&#62;If I have 18 fields to fill, do I need 18 separate gform_field_value functions?&#60;/p&#62;
&#60;p&#62;(And last but not least, are the gform_field_value functions defined as part of the gform_pre_render or as separate functions? If so, how do they know which form's fields to fill in?)&#60;/p&#62;
&#60;p&#62;Confused in Thornhill,&#60;/p&#62;
&#60;p&#62;Lawrence
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
