<?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: Best way to get entry id</title>
		<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id</link>
		<description>Gravity Support Forums Topic: Best way to get entry id</description>
		<language>en-US</language>
		<pubDate>Thu, 30 Apr 2026 04:00:51 +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/best-way-to-get-entry-id" rel="self" type="application/rss+xml" />

		<item>
			<title>italianbird on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-67471</link>
			<pubDate>Sun, 22 Jul 2012 21:46:27 +0000</pubDate>
			<dc:creator>italianbird</dc:creator>
			<guid isPermaLink="false">67471@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I've created an additional form field called 'Internal Pro Nbr'. I'd like that field to be populated by the entry number that is already assigned to each new form submission or record. These numbers start with 1 thru infinity and indicated on each new record. &#60;/p&#62;
&#60;p&#62;What we'd additionally like to do is throw in pre-leading characters such as CT00(entry id#).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chris Hajer on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-67455</link>
			<pubDate>Sun, 22 Jul 2012 20:42:46 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">67455@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;@italianbird, can you explain your scenario in a little more detail so we can help you with detailed instructions?  Thank you.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>italianbird on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-67443</link>
			<pubDate>Sun, 22 Jul 2012 18:06:10 +0000</pubDate>
			<dc:creator>italianbird</dc:creator>
			<guid isPermaLink="false">67443@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I need to reference the entry id in a newly created form field when a new entry is created. Perhaps pre-lead the entry id with the letters &#34;CT&#34;. How can I make this happen? I'm not a programmer, but I follow instructions quite well.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-58559</link>
			<pubDate>Thu, 10 May 2012 11:53:12 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">58559@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I see what you are trying to do, but I think this method is not 100% reliable. If two entries get submitted around the same time, you might end up using the wrong entry id. The chances of that happening are probably not very high, but it could happen. If you decide to do it this way, I would change the query to&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;SHOW TABLE STATUS WHERE name=&#38;#39;wp_rg_lead&#38;#39;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If you don't want to take that chance, use the gform_after_submission hook instead, where you have access to the entry id, then manually change the value of your hidden field using a sql statement:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$wpdb-&#38;gt;query(&#38;quot;UPDATE wp_rg_lead_detail SET value=&#38;#39;TRACKING_NUMBER&#38;#39; WHERE lead_id=ENTRY_ID AND field_number=HIDDEN_FIELD_ID&#38;quot;)&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>xehqter on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-58523</link>
			<pubDate>Thu, 10 May 2012 10:11:03 +0000</pubDate>
			<dc:creator>xehqter</dc:creator>
			<guid isPermaLink="false">58523@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I need to attach a reference number (entry ID) to a UPS label which is generated on gform_pre_submission_filter (before entry ID is generated) so that I can save the tracking number to a hidden field. &#60;/p&#62;
&#60;p&#62;The method in my initial post works, I just wanted to see if there was an official GF API call that did the same thing.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-58520</link>
			<pubDate>Thu, 10 May 2012 10:06:05 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">58520@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't know a good way to get the auto generated IDs before the record is created. The safe way to do this is to first create the record and then use $wpdb-&#38;gt;insert_id to read the ID that was created.&#60;br /&#62;
If you describe a little more what exactly you are trying to do, I may be able to help you with some alternatives.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>xehqter on "Best way to get entry id"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/best-way-to-get-entry-id#post-58267</link>
			<pubDate>Wed, 09 May 2012 03:10:47 +0000</pubDate>
			<dc:creator>xehqter</dc:creator>
			<guid isPermaLink="false">58267@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm using:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;global $wpdb;
$result = $wpdb-&#38;gt;get_results(&#38;quot;SHOW TABLE STATUS LIKE &#38;#39;wp_rg_lead&#38;#39;;&#38;quot;);
$entryId = $result[0]-&#38;gt;Auto_increment;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Is there a better way to get the entry ID before its generated?
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
