<?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: Display form entries using Search term</title>
		<link>https://legacy.forums.gravityhelp.com/topic/display-form-entries-using-search-term</link>
		<description>Gravity Support Forums Topic: Display form entries using Search term</description>
		<language>en-US</language>
		<pubDate>Sun, 19 Apr 2026 19:58: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/display-form-entries-using-search-term" rel="self" type="application/rss+xml" />

		<item>
			<title>Chris Hajer on "Display form entries using Search term"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/display-form-entries-using-search-term#post-193618</link>
			<pubDate>Mon, 01 Apr 2013 21:45:11 +0000</pubDate>
			<dc:creator>Chris Hajer</dc:creator>
			<guid isPermaLink="false">193618@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I don't think you can limit the search to specific fields when using RGFormsModel::get_leads.  You can use an additional loop beginning on line 13 to see if your specific field (in the $inquiries array) contains your $search string.  Then, proceed with your results.    Your first step is to pull out all the leads which have that text somewhere in the entry.  The new step will check to see if the specific field contains the search string.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>batterystudios on "Display form entries using Search term"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/display-form-entries-using-search-term#post-193353</link>
			<pubDate>Mon, 01 Apr 2013 17:17:51 +0000</pubDate>
			<dc:creator>batterystudios</dc:creator>
			<guid isPermaLink="false">193353@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;OK, I got the function working, but I cannot determine if there is a way to limit the search to a specific field.  Is this possible?&#60;/p&#62;
&#60;p&#62;Here is the working code&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// shortcode to display current post&#38;#39;s inquiries - used for front-end dashboard
add_shortcode( &#38;#39;inquiries&#38;#39;, &#38;#39;ik_show_inquiries&#38;#39;);
function ik_show_inquiries($atts) {
		//print_r($atts);exit;

		//set vars
		$form_id = &#38;#39;3&#38;#39;;
        $search = $atts[&#38;#39;search&#38;#39;];

		// function to pull entries from one form
        $inquiries = RGFormsModel::get_leads($form_id, &#38;#39;&#38;#39;, &#38;#39;DESC&#38;#39;, $search, &#38;#39;0&#38;#39;, $page_size=&#38;#39;99999999&#38;#39;);
		if(is_array($inquiries)){

		// show # of inquiries?
		if($atts[&#38;#39;showcount&#38;#39;]){
			$count = count($inquiries);
			if(!count)$count=&#38;#39;0&#38;#39;;
			$html = count($inquiries);
		}

		// show full details?
		if($atts[&#38;#39;hidelist&#38;#39;])
			return $html;

		$html .= &#38;quot;&#38;lt;ul class=&#38;#39;inquiries&#38;#39;&#38;gt;\n&#38;quot;;
        // loop through all the returned results
        $html .= &#38;#39;&#38;lt;li&#38;gt;searching for: &#38;#39;.$atts[&#38;#39;search&#38;#39;].&#38;quot;&#38;lt;/li&#38;gt;\n&#38;quot;;

			foreach ($inquiries as $inquiry) {

                $html .= &#38;quot;\t&#38;lt;li&#38;gt;&#38;quot;;
				$html .= $inquiry[&#38;#39;date_created&#38;#39;];
				//$html .= &#38;#39;,pre.&#38;#39;.print_r($inquiry,true).&#38;#39;&#38;lt;/pre&#38;gt;&#38;#39;;
				$html .= &#38;quot;&#38;lt;/li&#38;gt;\n&#38;quot;;

			}
		}
        $html .= &#38;#39;&#38;lt;/ul&#38;gt;&#38;#39;;

        // return the html output from the shortcode
        return $html;
}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>batterystudios on "Display form entries using Search term"</title>
			<link>https://legacy.forums.gravityhelp.com/topic/display-form-entries-using-search-term#post-193315</link>
			<pubDate>Mon, 01 Apr 2013 16:49:13 +0000</pubDate>
			<dc:creator>batterystudios</dc:creator>
			<guid isPermaLink="false">193315@https://legacy.forums.gravityhelp.com/</guid>
			<description>&#60;p&#62;I have a couple questions:&#60;/p&#62;
&#60;p&#62;1.  How do I access the GFFormsModel class from the front end to display form entries - when I try to access this in a shortcode function, it does not work (see code below)&#60;/p&#62;
&#60;p&#62;2. How do I properly use the $search parameter on a specific form field (see code below)&#60;/p&#62;
&#60;p&#62;When I run the function i have so far, the GFFormsModel::get_leads public function is not being calkled, and the $myLeads = 1 (no data array)&#60;/p&#62;
&#60;p&#62;Please advise, thanks!&#60;/p&#62;
&#60;p&#62;---&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;// shortcode to display current post&#38;#39;s inquiries - used for front-end dashboard
add_shortcode( &#38;#39;inquiries&#38;#39;, &#38;#39;ik_show_inquiries&#38;#39;);
function ik_show_inquiries($atts) {

	if($atts[&#38;#39;ID&#38;#39;]){
		//now i want to get the form entries while searching for the Post ID
		//shortcode $atts[&#38;#39;ID&#38;#39;] - data was submitted in one of the form fields)
		//$myLeads = RGFormsModel::get_leads(3, &#38;#39;&#38;#39;, &#38;#39;DESC&#38;#39;, $atts[&#38;#39;ID&#38;#39;], &#38;#39;0&#38;#39;, $page_size=&#38;#39;99999999&#38;#39;);
		$myLeads = GFFormsModel::get_leads(3, &#38;#39;&#38;#39;, &#38;#39;DESC&#38;#39;, $atts[&#38;#39;ID&#38;#39;], &#38;#39;0&#38;#39;, $page_size=&#38;#39;99999999&#38;#39;);
	} 

    //return print_r($myLeads);

    if(is_array($myLeads)){
		foreach($myLeads as $lead) {
			$html .= print_r($lead).&#38;quot;&#38;lt;br&#38;gt;&#38;quot;;
		}
	}

	return $html;

}&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
