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.

Output number of submissions of a selection to form

  1. I have a unique need, and I am pretty sure it is simple and I am over thinking this. Here is what I need.

    1. Have a form that is conditional
    2. Live output of the number of submissions of selected item from drop down

    What I mean is this. User fills out a form to contact my client. The form has a drop down with lets say 5 options (more or less as needed). The user chooses option 2. I need the form to conditionally show ONLY the needed details for options two (I can do this now with Gravity Forms) and I need it to show a output of the number of submissions for this option. The user would see this.

    I am pretty sure that it is possible, as I can use the "auto-populate" field option in a GF form, but I am not sure of the DB query that I would use.

    So, what I was thinking I could do is add a hidden field and call it #2submissions. What I need to know is if I can do a DB call to query and report back to the user in real time the number of times this type of request has been made.

    Posted 9 years ago on Tuesday January 22, 2013 | Permalink
  2. You can't do it after the form is loaded "in real time" but you can populate fields in your form using the gform_pre_render filter.

    The fields required for option two, for example, would all be present in your form when you build it, and you can use conditional logic to show or hide those required fields. Then you just need to pull from the database the number of selections which were made for each choice and display those conditionally as well. The fields will be present in the form builder and populated before the form is loaded and any field is shown, using the gform_pre_render filter.

    Does that help at all? Do you need help getting the data out of the database as well?

    Posted 9 years ago on Tuesday January 29, 2013 | Permalink