Count the number of entries in a Gravity Form

How can I sum all entries from a specific field as a counter?

To display number of entries submitted, insert this code on your page:

<?php
// count all entries for form ID 1, when key 2 has the value "true"
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
array(
'key' => '2',
'value' => true
)
)
);
$entry_count = GFAPI::count_entries(1, $search_criteria);
?>

1 Comment

  1. Hi, I need to put the entries left (remaining), inside a form in a gravity forms text-field.

    Can you help me pls?

    Reply

Submit a Comment

Your email address will not be published.