This seems like an extremely simple question, but no matter how I slice it, Gravity Forms only shows 20 entries even when GFAPI::count_entries() returns 52.
Here's the code:
$form_id=16;
$search_criteria = array( 'status' => 'active' );
$total_entries = GFAPI::count_entries( $form_id, $search_criteria );
echo '<h3>Count of entries: '.$total_entries.'</h4>';
// shows: Count of entries: 52 as expected
// great, now process each entry and get specific fields
$paging = array( 'offset' => 0, 'page_size' => 60 );
$allentries = GFAPI::get_entries( $form_id, $paging );
echo '<h3>Count of entries: '.count($allentries).'</h4>';
// shows: Count of entries: 20
$entryid = 25; // known data item
$firstEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 25: '.$firstEntry[20].'</h4>';
// shows: Name for 25: Todd
$entryid = 189; // known data item
$midEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 189: '.$midEntry[20].'</h4>';
// shows: Name for 189: Steve
$entryid = 525; // known data item
$lastEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 525: '.$lastEntry[20].'</h4>';
// shows: Name for 525: Graylin
I've added $page parameters, $search, etc., and nothing works...I only get the last 20 records submitted.
My goal is to cycle through the entries an get particular fields (e.g., firstname=[20], etc.).
Greatly appreciate the direction here.
Try this:
$entries = GFAPI::get_entries( $form_id, $search_criteria, null, $paging );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With