Get Total Value Of All Entries To A Caldera Forms Field

Tengger Caldera and Mount Bromo Volcano IE a Caldera

Note: This is developer facing documentation. There is a plugin under development to achieve this result.

If you have a numeric field, such as field used to specify a donation amount, and you wish to display the total of all entries in the field, you can, with a SQL query against the “cf_from_entry_values” table. This table has all entry values in the “value” column. You can select by “field_id” column as shown below:

If you wish to make this sum value a field’s value, for example to display in an HTML field, use the caldera_forms_render_get_field filter.

Show Caldera Forms Field Total Above Form

This next example shows how to create a custom shortcode that outputs the total value of a field and then the form.

This shortcode requires the ID of the field and the form. For example:

Where Does This Code Go?

When using WordPress hooks to customize Caldera Forms or other plugins you should not modify the plugin files, or you will lose your changes when you update the plugin. Instead you should create a small plugin to hold the custom code. It's easy, learn how here.

Technically you can add the custom code to your theme's functions.php, but then you will not be able to change your theme and keep these customizations.

Learn More