<?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: Dynamically populate fields sanity check</title>
		<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-sanity-check</link>
		<description>Gravity Support Forums Topic: Dynamically populate fields sanity check</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 02:55:27 +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/dynamically-populate-fields-sanity-check" rel="self" type="application/rss+xml" />

		<item>
			<title>rbl on "Dynamically populate fields sanity check"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-sanity-check#post-26662</link>
			<pubDate>Tue, 31 May 2011 18:44:30 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26662@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Duh moment! Thanks David! =)&#60;/p&#62;
&#60;p&#62;Ricardo
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Dynamically populate fields sanity check"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-sanity-check#post-26600</link>
			<pubDate>Mon, 30 May 2011 15:55:58 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">26600@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Ricardo,&#60;/p&#62;
&#60;p&#62;If you change the single quotes to double quotes on this line:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
$json = file_get_contents(&#38;#39;http://freegeoip.appspot.com/json/$ip&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;...you should be golden. PHP does not parse single quoted lines for variables so the IP is not being passed.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rbl on "Dynamically populate fields sanity check"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/dynamically-populate-fields-sanity-check#post-26562</link>
			<pubDate>Sun, 29 May 2011 17:32:55 +0000</pubDate>
			<dc:creator>rbl</dc:creator>
			<guid isPermaLink="false">26562@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi!&#60;br /&#62;
I want to use my form results in a map so I'm trying to get the user's latitude and longitude pair into the entry.&#60;br /&#62;
I created 2 fields, &#34;lat&#34; and &#34;lon&#34;, activated the option to dynamically populate and entered the same name in the parameter field (&#34;lat&#34; and &#34;lon&#34; respectively).&#60;/p&#62;
&#60;p&#62;I then added the following code to my functions php (omitted code for longitude as it's the same) but my fields are not being populated.&#60;/p&#62;
&#60;p&#62;JSON parsing works, field population works (tested static text) but together they don't work.&#60;br /&#62;
Does anyone knows why?&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_lat&#38;quot;, &#38;quot;populate_lat&#38;quot;);
function populate_lat($value){
	$ip = RGFormsModel::get_ip();
	$json = file_get_contents(&#38;#39;http://freegeoip.appspot.com/json/$ip&#38;#39;);
	$expression = json_decode($json);
	$lat = $expression-&#38;gt;latitude;
   return $lat;
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks!&#60;br /&#62;
Ricardo
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
