<?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: RGFormsModel::get_leads and some weird behavior..</title>
		<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior</link>
		<description>Gravity Support Forums Topic: RGFormsModel::get_leads and some weird behavior..</description>
		<language>en-US</language>
		<pubDate>Mon, 20 Apr 2026 07:55: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/rgformsmodelget_leads-and-some-weird-behavior" rel="self" type="application/rss+xml" />

		<item>
			<title>Dana Cobb on "RGFormsModel::get_leads and some weird behavior.."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior#post-53502</link>
			<pubDate>Mon, 26 Mar 2012 18:01:59 +0000</pubDate>
			<dc:creator>Dana Cobb</dc:creator>
			<guid isPermaLink="false">53502@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, innovatagroup,&#60;/p&#62;
&#60;p&#62;Below is a sample query for you. Your table names may be different depending on your WordPress database prefix, but they should have &#34;rg_lead&#34; and rg_lead_detail&#34; in the name. In the query below I am using form_id=53, change this to your form. I am selecting entries where the first name field has &#34;dana&#34; in it. My first name field is field id 1.3, but because the database field is a float, we use the BETWEEN clause and make the values a float, otherwise you won't get any data back. You would change this to your field id and still subtract and add to the field number.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;SELECT * FROM wp_rg_lead
JOIN wp_rg_lead_detail ON wp_rg_lead.id = wp_rg_lead_detail.lead_id
WHERE wp_rg_lead.form_id=53
AND field_number BETWEEN (1.3 - 0.001) AND (1.3 + 0.001)
AND value LIKE &#38;#39;%dana%&#38;#39;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Let me know if you have questions.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dana Cobb on "RGFormsModel::get_leads and some weird behavior.."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior#post-52862</link>
			<pubDate>Mon, 19 Mar 2012 13:04:44 +0000</pubDate>
			<dc:creator>Dana Cobb</dc:creator>
			<guid isPermaLink="false">52862@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, innovatagroup,&#60;/p&#62;
&#60;p&#62;I'll see what we can do.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>innovatagroup on "RGFormsModel::get_leads and some weird behavior.."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior#post-52661</link>
			<pubDate>Fri, 16 Mar 2012 09:40:49 +0000</pubDate>
			<dc:creator>innovatagroup</dc:creator>
			<guid isPermaLink="false">52661@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Dana,&#60;br /&#62;
Thank you for the reply -- I didn't realize that second parameter was the sort field. I was just piecing together the logic from looking at the core source.&#60;/p&#62;
&#60;p&#62;If you have some resource for creating a custom query, that'd be immensely helpful. I'm sure it would involve all sorts of &#34;fun&#34; joins, and someone with more knowledge of the software would probably have a better go at it. :)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Dana Cobb on "RGFormsModel::get_leads and some weird behavior.."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior#post-52643</link>
			<pubDate>Fri, 16 Mar 2012 00:50:28 +0000</pubDate>
			<dc:creator>Dana Cobb</dc:creator>
			<guid isPermaLink="false">52643@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hi, innovatagroup,&#60;/p&#62;
&#60;p&#62;The get_leads function does not allow you to pull leads by searching a specific field. The second parameter specifies by which field to sort the results. So, as you saw, if &#34;Tom&#34; is in any of the fields, that lead will be returned. We do not currently have a function that will allow you to select results by searching a single field, you would need to write your own database query. We can point you in the right direction if you need help with the query.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>innovatagroup on "RGFormsModel::get_leads and some weird behavior.."</title>
			<link>https://legacy.forums.gravityhelp.com/topic/rgformsmodelget_leads-and-some-weird-behavior#post-51733</link>
			<pubDate>Thu, 08 Mar 2012 08:38:32 +0000</pubDate>
			<dc:creator>innovatagroup</dc:creator>
			<guid isPermaLink="false">51733@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;Hey all,&#60;/p&#62;
&#60;p&#62;I've been using the RGFormsModel::get_leads() method to grab entries to a form, let's say form id #5, for use in some other code. I only want to grab entries whose first name field equals &#34;Tom&#34;, for example. The first name field is field id #10.&#60;/p&#62;
&#60;p&#62;So, from what I've found, you'd call:&#60;br /&#62;
         RGFromsModel::get_leads(5, 10, 'DESC', 'Tom&#34;);&#60;br /&#62;
Please correct me if I'm wrong here.&#60;/p&#62;
&#60;p&#62;However, what I find happening is this call will return results for &#34;Tom&#34; from *any field* in the entry. So if some named Paul entered &#34;Tomato&#34; as their favorite food, their entry is returned as well. It's like that second argument in the function call is completely ignored.&#60;/p&#62;
&#60;p&#62;Anyone else seen this happen? Seems to be a pretty significant bug if I'm understanding this function correctly. (And that's a big &#34;if&#34;)
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
