<?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: Pre populate List field</title>
		<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field</link>
		<description>Gravity Support Forums Topic: Pre populate List field</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 12:20:18 +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/pre-populate-list-field" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40581</link>
			<pubDate>Wed, 09 Nov 2011 10:41:37 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40581@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you for the update.  Glad that worked out.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>acsnaterse on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40573</link>
			<pubDate>Wed, 09 Nov 2011 09:14:37 +0000</pubDate>
			<dc:creator>acsnaterse</dc:creator>
			<guid isPermaLink="false">40573@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Alex, thanks! This works great!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40454</link>
			<pubDate>Tue, 08 Nov 2011 12:02:18 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">40454@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;You can pre-populate list field using the &#60;a href='http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name' rel=&#34;nofollow&#34;&#62;gform_field_value_$parameter_name&#60;/a&#62; filter.&#60;br /&#62;
Following is a sample snippet that will help you with the data format. This example assumes you used &#34;list&#34; as the parameter name for that field.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;quot;gform_field_value_list&#38;quot;, &#38;quot;populate_list&#38;quot;);
function populate_list($value){
   return array(&#38;quot;row 1 - col1&#38;quot;,&#38;quot;row 1 - col2&#38;quot;, &#38;quot;row 1 - col3&#38;quot;,
                &#38;quot;row 2 - col1&#38;quot;, &#38;quot;row 2 - col2&#38;quot;, &#38;quot;row 2 - col3&#38;quot;,
                &#38;quot;row 3 - col1&#38;quot;, &#38;quot;row 3 - col2&#38;quot;, &#38;quot;row 3 - col3&#38;quot;);

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>acsnaterse on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40404</link>
			<pubDate>Tue, 08 Nov 2011 06:56:44 +0000</pubDate>
			<dc:creator>acsnaterse</dc:creator>
			<guid isPermaLink="false">40404@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Well, in this case I want to use it for a wishlist, but I guess you also can use it for a kind e-commerce solution.&#60;/p&#62;
&#60;p&#62;So I have a bunch of products, and I'd like to display them in a GF list, with product name in column A and the quantity in column B. The product names have to be pre-populated (based on the contents of the wishlist). The quantity can be entered by the user.&#60;/p&#62;
&#60;p&#62;As far as I can see the (unserialized) &#34;format&#34; of the list data array (after submitting) is the following:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;Array
(
    [0] =&#38;gt; Array
        (
            [Product] =&#38;gt;
            [Quantity] =&#38;gt; 200
        )

    [1] =&#38;gt; Array
        (
            [Product] =&#38;gt; Product 2
            [Quantity] =&#38;gt; 400
        )

    [2] =&#38;gt; Array
        (
            [Product] =&#38;gt; Product 3
            [Quantity] =&#38;gt; 300
        )

)&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;However, I can't use this same format when populating the &#34;choices&#34; array in the gform_pre_render filter. So it would be great if we can :)&#60;/p&#62;
&#60;p&#62;any other solutions are fine too, but I think it's the easiest if the format stays the same.&#60;/p&#62;
&#60;p&#62;One backdraw however: for this method you need to know the exact name of the columns to use it for the array keys. Maybe it's better to just map it to a regular index.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40368</link>
			<pubDate>Tue, 08 Nov 2011 02:27:55 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">40368@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Can you post a use case for this?  It sounds interesting.  I will have one of the developers take a look at it.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>acsnaterse on "Pre populate List field"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/pre-populate-list-field#post-40231</link>
			<pubDate>Mon, 07 Nov 2011 04:49:04 +0000</pubDate>
			<dc:creator>acsnaterse</dc:creator>
			<guid isPermaLink="false">40231@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Is it also possible to dynamically pre-populate the &#34;new&#34; List field?&#60;/p&#62;
&#60;p&#62;It's no problem to do this with checkboxes or any other input type, but I can't find the &#34;format&#34; for the &#34;choices&#34; array items of this List field.&#60;/p&#62;
&#60;p&#62;Any help would be appreciated :)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
