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.

Capture infomation from user daily summarize it monthly

  1. I don't have a url to share because I haven't created the form yet.

    I'm building a membership site for a client who needs their members to visit a page each day to do a quick check in. The check-in has them answer a series of questions by checking 5-6 check boxes. At the end of the month we want to generate a report that summarizes the answers from the checkboxes. Obvously the data has to be linked to the mmeber's WP user id.

    In addition each member is to check in monthly by entering a number in one field and some text in 3-4 text fields. We need to display that data on the daily check-in page through out the month.

    Before I get too far down the road I thought I'd ask if Gravity Forms is a good application to capture the data? I've been using GF for several months but only to create simple forms. I'd like to use it for this application if it's a good fit.

    Hopefully this is enough information.

    Thank you very much.

    Bob

    Posted 13 years ago on Thursday January 13, 2011 | Permalink
  2. I would say Gravity Forms could do a wonderful job of collecting and storing this data. For presenting this data you would have to do a bit of custom coding, but if you are comfortable querying a DB table or able to make some enhancements to some sample code, this really should not be terribly difficult.

    As a starting point, here is a thread where a user needed to calculate values from the GF DB:

    http://forum.gravityhelp.com/topic/calculate-numbers-from-number-field-in-form-submissions

    Posted 13 years ago on Thursday January 13, 2011 | Permalink
  3. David,

    Thanks for the quick reply. After I wrote the post I looked through the database tables of a site with several GFs and see that it will do what I want. One thing I need to figure out how to capture the WP user id in the background. Do you have any links for this?

    Bob

    Posted 13 years ago on Thursday January 13, 2011 | Permalink
  4. You can add a hidden field, specify the dynamic population property under the advanced tab to something like "userid", and paste the following snippet into your functions.php file.

    http://pastie.org/1459593

    This will populate the hidden field with the currently logged in user's ID, which will then be stored as part of that entry.

    Posted 13 years ago on Friday January 14, 2011 | Permalink
  5. Thanks David. I see why they gave you that crown.

    Bob

    Posted 13 years ago on Thursday January 20, 2011 | Permalink
  6. David,

    Thanks again for your help. I also learned quite a bit from Ben Bradley's excellent webinars about Gravity Forms at webdesign.com. Great stuff.

    IN an earlier post you said that I could get some custom code to extract some data from the GF tables. I'm starting to work on that now and hoped that you could point me in the right direction.

    We have a memberhship site where members enter a set of yearly and monthly goals. I need to now display some of those fields on a page. One section will display the annual goals (2 number fields and 3 text fields) and another will show the current month's goals (3 text fields). The following month we'll need to see the new monthly goals Nothing complex just a little unclear.

    I'm very comfortable modifying existing code.

    Any advise or resources will be greatly appreciated.

    Bob

    Posted 13 years ago on Tuesday January 25, 2011 | Permalink
  7. Your basic database query is going to look something like this:

    function get_field_value($field_id, $entry_id){
    global $wpdb;
    
    $value = $wpdb->get_var("SELECT value FROM wp_rg_lead_detail WHERE lead_id = $entry_id AND field_number = $field_id");
    
    return $value;
    }
    
    echo get_field_value(4, 12);

    In this example, it assumes you know the users entry ID (12) and the field ID (4) of the value you want to retrieve.

    At this point in the game, you're going to want to get comfortable with the Gravity Forms table structure so take a peek in wp_rg_lead_detail and you'll see what information is available to you ( http://grab.by/8BoN ).

    Posted 13 years ago on Wednesday January 26, 2011 | Permalink
  8. Thanks David. This is a good start. I'll look through the tables

    Posted 13 years ago on Thursday January 27, 2011 | Permalink