PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Count entries with a specific field value

  1. Is there is some way to pass URL parameter into a hidden field in in the form being displayed and then (the mod important part of what I'm looking for) is there a way to then echo the count of form entries that have that specific hidden field value?

    What I'm tryin to do is link to a form from a "story" page. On this story page I would pull the title and put it into the a URL parameter for a link to the form. Once on the form it would pull that URL parameter (which would be the title of the story the user came from) and that parameter would populate a hidden field in the form and get submitted. What I then want to be able to do is have a counter on the story page above the link to the form that compares the page title to form entry values and if the hidden field Id equals the current page title echo the amount of entries that belong. The goal is to try and show people a count of how many other ls went to the form and filled it out from the story page . Does that make sense? And does anyone have any insights on how I can accomplish this?

    Posted 8 years ago on Friday February 15, 2013 | Permalink
  2. Anyone have any insights?

    Posted 8 years ago on Saturday February 16, 2013 | Permalink
  3. It does make sense a little bit. I've read it about 4 times now. You will be sending people from a story page to the form page, and when you send them there, you want to send the visitor to the form and pre-populate the title of the page where the visitor came from. Is that correct? That is one issue, if so.

    Here is an explanation of how to populate a field dynamically:

    The second issue is that you want to populate a field on a WordPress page (your story page) showing how many people have clicked through to the form and submitted, which would have populated the title field in the form with this page's title. So, you want to query the form entries for this one form, and see how many times this title occurs in the one field, thus returning a count you can use on the story page. Is that accurate? If so, that is issue number two, totally unrelated to number one.

    Here are a couple ways of getting the total number of entries for a form:

    You would need to filter somewhat more to match only the ones with your desired value stored in your hidden field.

    If you have any of this online now that we can take a look at, please post the URLs so we can see it in person.

    Posted 8 years ago on Monday February 18, 2013 | Permalink
  4. Hi Chris,

    Thanks so much for getting back to me on this.
    So sounds like you hit the nail on the head about what we are trying to do - but I have done some further digging and found that perhaps there may be a better way? Can you let me know if this would be possible instead - if so how I would go about setting it up??

    It sounds like there is a source_url value stored in the wp_rg_lead table? And that is the referring page correct? So perhaps I can just pull that on the stories page - check if it matches the current URL and count the number of entries that do? Essentially we are trying to get the count of the number of times the registration form has been submitted in someones honor - does that make sense and is it possible?

    URL to the dev site is
    and this is also an example of a story page - you can see the counter (not working as should) and register in honor of link below the image.

    Posted 8 years ago on Monday February 18, 2013 | Permalink
  5. Yes, there is a source_url field in the wp_rg_lead table. Yes, that is how someone got to the page with the form embedded in it (the referring page.) You can do exactly as you describe, count the entries where this source_url is identical.

    Posted 8 years ago on Monday February 18, 2013 | Permalink