<?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 fields without a filter</title>
		<link>https://legacy.forums.gravityhelp.com/topic/populating-fields-without-a-filter</link>
		<description>Gravity Support Forums Topic: Populating fields without a filter</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 18:18:38 +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-fields-without-a-filter" rel="self" type="application/rss+xml" />

		<item>
			<title>peterarends on "Populating fields without a filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-fields-without-a-filter#post-279861</link>
			<pubDate>Mon, 27 May 2013 03:43:04 +0000</pubDate>
			<dc:creator>peterarends</dc:creator>
			<guid isPermaLink="false">279861@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Until then you can use something like:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;foreach($form[&#38;#39;fields&#38;#39;] as &#38;amp;$field){
	$id=$field[&#38;#39;id&#38;#39;];

	switch($field[&#38;#39;type&#38;#39;]){
		case &#38;#39;checkbox&#38;#39;:
			$f=json_decode($meta[&#38;#39;f&#38;#39;.$id][0],true);
			foreach($field[&#38;#39;choices&#38;#39;] as &#38;amp;$choice){
				if($f[$choice[&#38;#39;value&#38;#39;]]==&#38;#39;1&#38;#39;){
					$choice[&#38;#39;isSelected&#38;#39;]=&#38;#39;true&#38;#39;;
				}
			}
		break;
		case &#38;#39;textarea&#38;#39;:
		case &#38;#39;text&#38;#39;:
		case &#38;#39;website&#38;#39;:
			$field[&#38;#39;defaultValue&#38;#39;]=$meta[&#38;#39;f&#38;#39;.$id][0];
		break;
		case &#38;#39;radio&#38;#39;:
			foreach($field[&#38;#39;choices&#38;#39;] as &#38;amp;$choice){
				if($choice[&#38;#39;value&#38;#39;]==$meta[&#38;#39;f&#38;#39;.$id][0]){
					$choice[&#38;#39;isSelected&#38;#39;]=&#38;#39;true&#38;#39;;
				}
			}
		break;
	}
	if($id==&#38;#39;43&#38;#39;){

		//$field[&#38;#39;description&#38;#39;]=&#38;#39;&#38;lt;div id=&#38;quot;creditinfo&#38;quot;&#38;gt;oke&#38;lt;/div&#38;gt;&#38;#39;.$field[&#38;#39;description&#38;#39;];

	}
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>peterarends on "Populating fields without a filter"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populating-fields-without-a-filter#post-270143</link>
			<pubDate>Thu, 23 May 2013 06:23:34 +0000</pubDate>
			<dc:creator>peterarends</dc:creator>
			<guid isPermaLink="false">270143@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;So, I used to use this kind code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$form[&#38;#39;fields&#38;#39;][&#38;#39;1&#38;#39;][&#38;#39;defaultValue&#38;#39;]=$current_user-&#38;gt;data-&#38;gt;user_email;
$form[&#38;#39;fields&#38;#39;][&#38;#39;0&#38;#39;][&#38;#39;defaultValue&#38;#39;][&#38;#39;1.3&#38;#39;]=$user_info-&#38;gt;user_firstname;
$form[&#38;#39;fields&#38;#39;][&#38;#39;0&#38;#39;][&#38;#39;defaultValue&#38;#39;][&#38;#39;1.6&#38;#39;]=$user_info-&#38;gt;user_lastname;
$form[&#38;#39;fields&#38;#39;][&#38;#39;2&#38;#39;][&#38;#39;defaultValue&#38;#39;]=get_user_meta( $current_user-&#38;gt;ID, &#38;#39;bedrijfsnaam&#38;#39;, true );
$form[&#38;#39;fields&#38;#39;][&#38;#39;3&#38;#39;][&#38;#39;defaultValue&#38;#39;][&#38;#39;4.1&#38;#39;]=get_user_meta( $current_user-&#38;gt;ID, &#38;#39;straatnaam&#38;#39;, true );
$form[&#38;#39;fields&#38;#39;][&#38;#39;3&#38;#39;][&#38;#39;defaultValue&#38;#39;][&#38;#39;4.3&#38;#39;]=get_user_meta( $current_user-&#38;gt;ID, &#38;#39;postcode&#38;#39;, true );
$form[&#38;#39;fields&#38;#39;][&#38;#39;3&#38;#39;][&#38;#39;defaultValue&#38;#39;][&#38;#39;4.5&#38;#39;]=get_user_meta( $current_user-&#38;gt;ID, &#38;#39;plaats&#38;#39;, true );&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Which works perfect until you change around the order of the fields for example. It was intuitive to me, but not supported I guess.&#60;/p&#62;
&#60;p&#62;What I would like is that the field number would not be incremental. Now the first is $form['fields']['0'], the second is $form['fields']['1'], etc. But would get the ID of the field.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
