WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Directory
Trying to replicate cforms functionality (9 posts)

  1. LizBlue
    Member
    Posted 2 years ago #

    I used cforms to build questionnaire and a query of the responses for display on another page. You can see how the simple query works here. Give it a try to see what I'm trying to do.

    I use functions like "get_cforms_data" to pull responses from the database cforms created. It all works great, in theory. However, the actual questionnaire is too long for one page so I need to split it into mulitple pages and that's where cforms has lots of problems. Can't get the multipage thing to work for me at all there.

    So, I bought Gravity Forms and really like the form building stuff, but I can't find how to pull data out of the database of responses the way I was able to do it in cforms. (the lingo of 'leads' and 'directories' is baffling to me too)

    Can I use this plug in for that purpose?

    http://wordpress.org/extend/plugins/gravity-forms-addons/

  2. Zack Katz
    Member
    Plugin Author

    Posted 2 years ago #

    Gravity Forms has so many options to work with the submission information. One of the hooks is gform_save_field_value.

    There's not only tons of info on http://www.gravityhelp.com, but when you purchase Gravity Forms, you get a year of great support and they're happy to help walk you through it.

  3. LizBlue
    Member
    Posted 2 years ago #

    This is what the Gravity Forms guy said when I asked him the same question that I asked you:

    Currently Gravity Forms does not have built in functions for displaying entry data on the front end. You would have to do this either by querying and displaying the entry data or by using a 3rd party add-on such as:

    http://wordpress.org/extend/plugins/gravity-forms-addons/

    Displaying entry data on the front end is a feature we plan on focusing on in the 1.7 release of Gravity Forms.

    Not sure what he means by front end. I'm really hoping to post-process the data that is collected, if there is a way to do it. Is there a way to get at the data after it has been submitted? Does your plugin offer that capability?

    Thanks!

  4. Zack Katz
    Member
    Plugin Author

    Posted 2 years ago #

    Gravity Forms does have that capability. I think it'd be helpful if you further explained how that data would then be used.

  5. LizBlue
    Member
    Posted 2 years ago #

    Well, here's a code snippet from the page template file that I was using to pull data from the cforms database and use it. I really need a function equivalent to "get_cforms_entries(form_name)". Can you point me in the right direction? The Gravity Forms guy, even though I paid for it, was not helpful.

    Thanks!

    <?php
    			$responses = get_cforms_entries('Candidate questionnaire');   /* all data, no filters */
    			?>
    
    <?php function general_topic($candidate, $responses) {
    					echo '<table rules="rows">';
    					echo '<tr><td width=30%></td><td width=70%></td></tr>';
    					foreach( $responses as $e ){
    
    						if ( $e['data']['Your Name'] == $candidate ) {
    							echo '<tr><td>Why do you want to serve on City Council?</td><td>' . $e['data']['Why do you want to serve on City Council?'] . '</td><tr>';
    							echo '<tr><td>What is the highest priority issue in Boulder right now?</td><td>' . $e['data']['What is the highest priority issue in Boulder right now?'] . '</td><tr>';
    							if ($e['data']['Will you be adbiding by campaign finance limits?'] == 'on') {
    								echo '<tr><td>Will you be abiding by campaign finance limits?</td><td>' . 'Yes' . '</td><tr>';}
    							else { echo '<tr><td>Will you be abiding by campaign finance limits?</td><td>' . 'No' . '</td><tr>';
    							}
    						}
    					}
    					echo '</table>';
    				}
    			?>
  6. Zack Katz
    Member
    Plugin Author

    Posted 2 years ago #

    It sounds like you may want to use conditional logic to show or hide questions based on responses. http://www.gravityhelp.com/documentation/page/Enable_Conditional_Logic

  7. LizBlue
    Member
    Posted 2 years ago #

    Dear Zach,

    Thanks so much for sticking with me here. I am going to try to be more clear about what I'm trying to do.

    Tomorrow, my organization is going to ask the city council candidates to fill out our questionnaire, a form I built with Gravity Forms. They will have 10 days to fill it out.

    On the 18th, we will make the candidates' responses available to the voters. I am trying to set up a system where the voters can choose a candidate's name and a topic and get the responses just for that candidate and topic, instead of a flood of responses from all candidates on all topics.

    Before, with cforms, I was able to do this by passing the selected candidate and topic to a page template that executed some php script that retrieved the array responses (get_cforms_data(form_name)) and pulled out just the responses the user wanted to see. It worked great.

    So now, I'm trying to find the function that would get the array of responses from a Gravity Forms form. I also need the array structure, of course.

    Does that make sense? So I don't want to hide questions or anything like that. I am done with the form itself once all the candidates have filled it out.

    Thanks.

  8. Zack Katz
    Member
    Plugin Author

    Posted 2 years ago #

    Well this directory plugin does that: if you add a directory, select the candidate form and it will display all entries - sorted by candidate if you want - with each response they filled out.

    If the form ID is 4, the directory code would be [directory form="4"] - that will show the responses in the page content.

    An update is coming soon that will also make it easier to use fields as links to the single entry; candidate's names could be clickable to the single entry view, which would show their responses.

  9. shwood24
    Member
    Posted 2 years ago #

    Can you customize the directory layouts? I'm a novice, and see that I have three choices for the directory display (table, ul, definition list). None of them is satisfactory. They all leave data out, and I'm not sure how to customize them to show what I want them to. Also, when I go from the directory to a single entry, the entry is incomplete.
    Thanks.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic