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.

Entries Count for certain set of date range

  1. enclave
    Member

    Hi there,

    I found this pastie related to how to display an total number of Entries for a particular GF ID.

    http://pastie.org/2051574

    1. Date range
    However, I was wondering how do I make so that I can filter this for a certain number of days e.g. 30 days, 60 days. Manual code insertion is good for now.

    2. Include the list of all forms on website
    How do I list down the total number of entries for all forms (So, that I don't have to put 10 codes for 10 forms).

    Posted 6 years ago on Monday March 25, 2013 | Permalink
  2. The Gravity Forms function get_form_counts accepts just one argument: form ID. There is no filtering possible there. Instead, I would use the get_lead_count function. Here are the arguments you can use with that function:

    [php]
    get_lead_count($form_id, $search, $star=null, $read=null, $start_date=null, $end_date=null, $status=null)

    You can add your dates to filter by as parameters sent to that function.

    To get the lead counts for all forms on the site, include that function in a loop to loop through all your forms. You can use RGFormsModel::get_forms(); to get a list of all forms. You can call it like this:

    [php]
    $forms = RGFormsModel::get_forms(1, "ID ASC");

    That will return an array of all active forms sorted by ID ascending. Then you can loop through all the IDs and call your get_lead_count function.

    Posted 6 years ago on Monday March 25, 2013 | Permalink
  3. enclave
    Member

    Hi there,

    I'm fairly new on how to use this. Can you provide the complete PHP code so that I can put it in a functions.php or create a shortcode out of it so that I can use it.

    Cheers Chris, you rock the GF support!

    Posted 6 years ago on Tuesday April 9, 2013 | Permalink