Get Entries From A Form

Caldera Forms provides a form entry viewer in the backend. This article is for developers who wish to access saved entires programmatically via PHP.

It is worth noting that an alternative to Caldera Forms’ default entry tracking is to use your own custom saving using the Caldera Forms Run Action processor to save data in a post, as meta data, options or in your own custom table. Learn more here. Doing so will make it easier to query for specific data and also to fit the data storage and queries to your own needs.

When using the default storage, you can repurpose the Caldera_Forms_Admin class to retrieve entires programmatically. The method get_entries was created in version 1.2.1 for this purpose. The following code snippet illustrates how to get all entries of a form into an array:

//in front-end admin class is not included
require_once( CFCORE_PATH . 'classes/admin.php' );

//Be sure to set the correct form ID below
$form_id = 'CF557dd7b7739ac';

//get all entires (page 1 with 9999999 entries per page should do it:)
$data = Caldera_Forms_Admin::get_entries( $form_id, 1, 9999999 );

//$data has extra meta info. $entries has just the entries
$entires = $data[ 'entries' ];