<?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: Update Lead Meta</title>
		<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta</link>
		<description>Gravity Support Forums Topic: Update Lead Meta</description>
		<language>en-US</language>
		<pubDate>Sat, 04 Apr 2026 13:43:32 +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/update-lead-meta" rel="self" type="application/rss+xml" />

		<item>
			<title>David Peralty on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-265750</link>
			<pubDate>Tue, 21 May 2013 11:24:13 +0000</pubDate>
			<dc:creator>David Peralty</dc:creator>
			<guid isPermaLink="false">265750@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I'm going to move this to feature requests so people can continue to leave their support.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>webaware on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-263969</link>
			<pubDate>Mon, 20 May 2013 22:52:47 +0000</pubDate>
			<dc:creator>webaware</dc:creator>
			<guid isPermaLink="false">263969@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;+1 for a GFFormsModel::save_input() like function for updating lead details without form input.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>stoutdesign on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-24533</link>
			<pubDate>Fri, 29 Apr 2011 14:22:25 +0000</pubDate>
			<dc:creator>stoutdesign</dc:creator>
			<guid isPermaLink="false">24533@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I vote for this  as well&#60;br /&#62;
&#60;blockquote&#62;It would be useful for a having a few template functions for working with form data. Simple update, edit, retrieve, delete functions. While this goes beyond just data collection and the core of Gravity Forms it would massively increase the flexibility of the plugin.&#60;/p&#62;&#60;/blockquote&#62;</description>
		</item>
		<item>
			<title>toggle on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-22935</link>
			<pubDate>Mon, 11 Apr 2011 09:52:06 +0000</pubDate>
			<dc:creator>toggle</dc:creator>
			<guid isPermaLink="false">22935@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi Alex&#60;br /&#62;
Thanks for getting back. I have written the following code and it works well. My form redirects the user to a URL with a unique GET variable. This unique ID is used to retrieve the form information and then update the download counter. Only a certain number of downloads are permitted. Hopefully the code will be of use to others:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;global $wpdb;

// get gravity forms
$rg = new RGFormsModel(); 

// search for this UID on form 2
$download = $rg-&#38;gt;get_leads(2, 0, &#38;#39;DESC&#38;#39;, $_GET[&#38;#39;uid&#38;#39;], 0, 1000);	

// invalid UID
if (!$download) { wp_die(__(&#38;#39;Invalid download link.&#38;#39;,&#38;#39;oo&#38;#39;).&#38;#39; &#38;lt;a href=&#38;quot;&#38;#39;.get_bloginfo(&#38;#39;url&#38;#39;).&#38;#39;&#38;quot;&#38;gt;&#38;#39;.__(&#38;#39;Get me out of here »&#38;#39;,&#38;#39;oo&#38;#39;).&#38;#39;&#38;lt;/a&#38;gt;&#38;#39;); }

// counter
$counter = $download[0][5];
if ($counter &#38;gt;= 2) { wp_die(__(&#38;#39;File download limit exceeded.&#38;#39;,&#38;#39;oo&#38;#39;).&#38;#39; &#38;lt;a href=&#38;quot;&#38;#39;.get_bloginfo(&#38;#39;url&#38;#39;).&#38;#39;&#38;quot;&#38;gt;&#38;#39;.__(&#38;#39;Get me out of here »&#38;#39;,&#38;#39;oo&#38;#39;).&#38;#39;&#38;lt;/a&#38;gt;&#38;#39;); }

// update the counter (form 2, field 5)
$lead_detail_table = $rg-&#38;gt;get_lead_details_table_name();
$count = $counter + 1;
$save = $wpdb-&#38;gt;update($lead_detail_table, array(&#38;quot;value&#38;quot; =&#38;gt; $count), array(&#38;quot;lead_id&#38;quot; =&#38;gt; $download[0][&#38;quot;id&#38;quot;], &#38;quot;form_id&#38;quot; =&#38;gt; 2, &#38;quot;field_number&#38;quot; =&#38;gt; 5));&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;It would be useful for a having a few template functions for working with form data. Simple update, edit, retrieve, delete functions. While this goes beyond just data collection and the core of Gravity Forms it would massively increase the flexibility of the plugin.&#60;/p&#62;
&#60;p&#62;Thank again&#60;/p&#62;
&#60;p&#62;Scott
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Alex Cancado on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-22798</link>
			<pubDate>Fri, 08 Apr 2011 11:54:44 +0000</pubDate>
			<dc:creator>Alex Cancado</dc:creator>
			<guid isPermaLink="false">22798@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Unfortunately, there isn't a function to update the lead detail table. The code used to update lead details is inside the RGFormsModel::save_input() method, but that method relies on the $_POST variable to read the field values, so it won't work for you. You will have to write your own SQL queries for that one. That table is pretty straight forward, just remember that the field_number column relates to the field ID. Also, you will note that the value column can only take 200 characters. If your value is larger than 200, you will need to also add a record to the wp_rg_lead_detail_long table.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>toggle on "Update Lead Meta"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/update-lead-meta#post-22776</link>
			<pubDate>Fri, 08 Apr 2011 09:14:06 +0000</pubDate>
			<dc:creator>toggle</dc:creator>
			<guid isPermaLink="false">22776@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi&#60;br /&#62;
I am looking at ways of updating saved leads after the initial lead has been saved. I have been digging around forms_model.php and came up with the following code:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;@include_once(WP_PLUGIN_DIR . &#38;quot;/gravityforms/gravityforms.php&#38;quot;);
@include_once(WP_PLUGIN_DIR . &#38;quot;/gravityforms/forms_model.php&#38;quot;);
$rg = new RGFormsModel(); 

$lead_id = 12;

$rg-&#38;gt;update_lead_property($lead_id, &#38;#39;custom&#38;#39;, 200);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;If I am trying to adjust a field within the rg_lead table (starred, ip, etc) then it would appear to work. However I cannot get it to update any value in the rg_lead_detail table - the custom field data for my form. &#60;/p&#62;
&#60;p&#62;Is there a function or class available for interacting with the rg_lead_detail table. Something like:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;$rg-&#38;gt;update_lead_property_meta($lead_id, &#38;#39;custom&#38;#39;, 200);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
