<?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: Help with user ID creation</title>
		<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation</link>
		<description>Gravity Support Forums Topic: Help with user ID creation</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 10:07:44 +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/help-with-user-id-creation" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47884</link>
			<pubDate>Tue, 31 Jan 2012 01:27:38 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">47884@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;The 10 is the priority (10 is the default priority) and the 4 is the number of arguments you must send to the function.  &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;$username, $config, $form, $entry&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;You can read about it here:&#60;br /&#62;
&#60;a href=&#34;http://codex.wordpress.org/Function_Reference/add_filter&#34; rel=&#34;nofollow&#34;&#62;http://codex.wordpress.org/Function_Reference/add_filter&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This is WordPress functionality, not Gravity Forms specific.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rusjames on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47405</link>
			<pubDate>Thu, 26 Jan 2012 00:56:56 +0000</pubDate>
			<dc:creator>rusjames</dc:creator>
			<guid isPermaLink="false">47405@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;David in this line of code  add_filter('gform_username', 'userID', 10, 4); what does the 10,4 mean?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>twymand on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47372</link>
			<pubDate>Wed, 25 Jan 2012 18:34:44 +0000</pubDate>
			<dc:creator>twymand</dc:creator>
			<guid isPermaLink="false">47372@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Rusjames,&#60;/p&#62;
&#60;p&#62;Not sure if this is something you might be interested in but we use the below code which  you would place in your functions folder to generate a random 8 digit number with a prefix( in the below sample the prefix is ebar.&#34; You would want to update that with what ever you would want. As well as change the form_id to the form number you are using and the field_id with the id of the  form field your trying to populate with the random number. &#60;/p&#62;
&#60;p&#62;Then under that specific field you would want to modify the entry to check the box that says &#34;Allow field to be populated dynamically &#34; then in the field provided add the letters &#34;uuid&#34; without quotes. You can make this field admin only or allow them to see it but either way you will get a random unique id that can then be used in any fashion you would like. &#60;/p&#62;
&#60;p&#62;Hope this gets you a little closer and is what you were looking for.&#60;/p&#62;
&#60;p&#62;add_filter(&#34;gform_field_value_uuid&#34;, &#34;get_unique&#34;);&#60;/p&#62;
&#60;p&#62;function get_unique(){&#60;/p&#62;
&#60;p&#62;    $prefix = &#34;eBar&#34;; // update the prefix here&#60;/p&#62;
&#60;p&#62;    do {&#60;br /&#62;
        $unique = mt_rand();&#60;br /&#62;
        $unique = substr($unique, 0, 8);&#60;br /&#62;
        $unique = $prefix . $unique;&#60;br /&#62;
    } while (!check_unique($unique));&#60;/p&#62;
&#60;p&#62;    return $unique;&#60;br /&#62;
}&#60;/p&#62;
&#60;p&#62;function check_unique($unique) {&#60;br /&#62;
    global $wpdb;&#60;/p&#62;
&#60;p&#62;    $table = $wpdb-&#38;gt;prefix . 'rg_lead_detail';&#60;br /&#62;
    $form_id = 7; // update to the form ID your unique id field belongs to&#60;br /&#62;
    $field_id = 1; // update to the field ID your unique id is being prepopulated in&#60;br /&#62;
    $result = $wpdb-&#38;gt;get_var(&#34;SELECT value FROM $table WHERE form_id = '$form_id' AND field_number = '$field_id' AND value = '$unique'&#34;);&#60;/p&#62;
&#60;p&#62;    if(empty($result))&#60;br /&#62;
        return true;&#60;/p&#62;
&#60;p&#62;    return false;&#60;br /&#62;
}
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47363</link>
			<pubDate>Wed, 25 Jan 2012 18:12:43 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">47363@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Rusjames,&#60;/p&#62;
&#60;p&#62;The code would go in your theme's &#60;em&#62;functions.php&#60;/em&#62; file. A good base to start from would be to use the example code provided at the bottom of the gform_username documentation. You'll want to modify your filter slightly in order to pass the parameters to your function:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;[php]
add_filter(&#38;#39;gform_username&#38;#39;, &#38;#39;your_function_name&#38;#39;, 10, 4);
function your_function_name($username, $config, $form, $entry) {
   ...
}&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Also, I neglected to mention that you likely need an unreleased version of the User Registration Add-on. Send me an email at &#60;a href=&#34;mailto:david@rocketgenius.com&#34;&#62;david@rocketgenius.com&#60;/a&#62; and I will send this to you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rusjames on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47361</link>
			<pubDate>Wed, 25 Jan 2012 17:52:33 +0000</pubDate>
			<dc:creator>rusjames</dc:creator>
			<guid isPermaLink="false">47361@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Thank you David for getting back to me a couple of things i am not sure how to code it to the the way that i would like and even where to put the code after it was coded is there anyway that you can give me at least a start so that I can see how to make the changes that are needed?&#60;/p&#62;
&#60;p&#62;This would be very helpful and appreciated.&#60;/p&#62;
&#60;p&#62;Rus
&#60;/p&#62;</description>
		</item>
		<item>
			<title>David Smith on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47354</link>
			<pubDate>Wed, 25 Jan 2012 17:32:03 +0000</pubDate>
			<dc:creator>David Smith</dc:creator>
			<guid isPermaLink="false">47354@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Rusjames,&#60;/p&#62;
&#60;p&#62;When you say user ID it sounds like you're actually talking about a username. The user ID is controlled by WordPress and will be whatever the next available ID is in the wp_user table.&#60;br /&#62;
If you'd like to generate a dynamic user name based on a variety of parameters, I'd suggest checking out the gforms_username filter.&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.gravityhelp.com/documentation/page/Gform_username&#34; rel=&#34;nofollow&#34;&#62;http://www.gravityhelp.com/documentation/page/Gform_username&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This filter will allow you to create a custom function to alter the username based on your own parameters. The $entry object is passed so you can pull submitted field values and create a custom username based on them.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>rusjames on "Help with user ID creation"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/help-with-user-id-creation#post-47098</link>
			<pubDate>Sun, 22 Jan 2012 22:19:47 +0000</pubDate>
			<dc:creator>rusjames</dc:creator>
			<guid isPermaLink="false">47098@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I need help with adding some functionality to my form (if possible) my form is at &#60;a href=&#34;http://www.airsimcorp.com/registration&#34; rel=&#34;nofollow&#34;&#62;http://www.airsimcorp.com/registration&#60;/a&#62;&#60;br /&#62;
I need a few things if anyone can help a image to help see what I am talking about is at &#60;a href=&#34;http://rus.tinygrab.com/bDzy&#34; rel=&#34;nofollow&#34;&#62;http://rus.tinygrab.com/bDzy&#60;/a&#62;&#60;br /&#62;
1. I need to take data for three fields in my form and spit out a user ID for the person registering. I need it to be displayed on the Thank you for registering page after they register and also add them to my user list and send them an email with there user ID. I am using the user registation add-on. The user does not need a password (because they are not going to be using the user ID to log on to my website) but i would like one created for later use.&#60;/p&#62;
&#60;p&#62;2. I am using a number generator widget with my for to create a random number for there user ID (one of the pieces of data that I am using to create the user ID) I need a way to check that the number that is generated is the number that they are entering into the field unless there is a way to generate a random number automatically then I can remove the widget and the number field and make things completely that much easier. &#60;/p&#62;
&#60;p&#62;A little side note I am not a coder (yet want to learn) and do not know much with the guts of Wordpress so if coding and diving into the guts of Wordpress is involved I will need help with the code and where to put it so that will work. Or if someone is willing to teach me what I need to do that will be very helpful and appreciated. &#60;/p&#62;
&#60;p&#62;Rus
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
