<?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: Populate dynamically when form sent</title>
		<link>https://legacy.forums.gravityhelp.com/topic/populate-dynamically-when-form-sent</link>
		<description>Gravity Support Forums Topic: Populate dynamically when form sent</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 09:38:35 +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/populate-dynamically-when-form-sent" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Populate dynamically when form sent"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-dynamically-when-form-sent#post-160175</link>
			<pubDate>Mon, 04 Mar 2013 15:27:06 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">160175@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;How many subscribers do you have?  If there are a lot, I can see this code being slow since you are going through all your users in the loop.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>groupewibi on "Populate dynamically when form sent"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-dynamically-when-form-sent#post-156466</link>
			<pubDate>Thu, 28 Feb 2013 03:14:49 +0000</pubDate>
			<dc:creator>groupewibi</dc:creator>
			<guid isPermaLink="false">156466@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Ok. I have modify my code to and use the function gform_pre_submission. But it's seem very slow when i sending a form now. Any Idea ? &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_action(&#38;quot;gform_pre_submission_2&#38;quot;, &#38;quot;pre_submission_handler&#38;quot;);
function pre_submission_handler($form){
    $args = array(
	&#38;#39;role&#38;#39; =&#38;gt; &#38;#39;Subscriber&#38;#39;,
);

// The Query
$user_query = new WP_User_Query( $args );

// User Loop
if ( !empty( $user_query-&#38;gt;results ) ) {
	foreach ( $user_query-&#38;gt;results as $user ) :
		$uuid = get_user_meta( $user-&#38;gt;ID, &#38;#39;user_uuid&#38;#39;, true);
		//echo &#38;#39;&#38;lt;p&#38;gt;&#38;#39; . $user-&#38;gt;display_name . &#38;#39;, Membre n° &#38;#39;.$uuid.&#38;#39;&#38;lt;/p&#38;gt;&#38;#39;;
		$nummembre[] = $uuid;
	endforeach;
	$maxnummembre = (max($nummembre) + 1);
	$_POST[&#38;quot;input_14&#38;quot;] = $maxnummembre;

	//echo &#38;#39;Nouveau : &#38;#39;.$maxnummembre;
    //return $maxnummembre;
}
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>groupewibi on "Populate dynamically when form sent"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/populate-dynamically-when-form-sent#post-156448</link>
			<pubDate>Thu, 28 Feb 2013 02:28:08 +0000</pubDate>
			<dc:creator>groupewibi</dc:creator>
			<guid isPermaLink="false">156448@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Dear all, &#60;/p&#62;
&#60;p&#62;I trying to affect a user card member using the biggest value found on the user_meta table sor subscribers. Everythinks is working well, but i have an issue. &#60;/p&#62;
&#60;p&#62;Im changing the value of an hidden field (user_uuid) with a hook, and affect him a value.&#60;br /&#62;
Problem is, two person can be connected at the same time, using the same form, and has the same populated value at the same time. &#60;/p&#62;
&#60;p&#62;Solution should be to affect the value, only when the form is sent.&#60;br /&#62;
Any idea how to make it ? &#60;/p&#62;
&#60;p&#62;My code bellow.  &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;add_filter(&#38;#39;gform_field_value_maxnummembre&#38;#39;, &#38;#39;populate_memberid&#38;#39;);
function populate_memberid($value){
    $args = array(
	&#38;#39;role&#38;#39; =&#38;gt; &#38;#39;Subscriber&#38;#39;,
);

// The Query
$user_query = new WP_User_Query( $args );

// User Loop
if ( !empty( $user_query-&#38;gt;results ) ) {
	foreach ( $user_query-&#38;gt;results as $user ) :
		$uuid = get_user_meta( $user-&#38;gt;ID, &#38;#39;user_uuid&#38;#39;, true);
		echo &#38;#39;&#38;lt;p&#38;gt;&#38;#39; . $user-&#38;gt;display_name . &#38;#39;, Membre n° &#38;#39;.$uuid.&#38;#39;&#38;lt;/p&#38;gt;&#38;#39;;
		$nummembre[] = $uuid;
	endforeach;

	$maxnummembre = (max($nummembre) + 1);
	echo &#38;#39;Nouveau : &#38;#39;.$maxnummembre;
    return $maxnummembre;
}
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
