View Categories

How to display WPForms Field Calculations in table footer

1 min read

If you want to display WPForms Field Calculations in table footer please follow below steps. #

You will need :
1. Views for WPForms Professional or Developer License Add-on

2. Calculations Add-on

Follow these steps to configure and enable this functionality:

wpforms views calculations

1. Access the Field Settings

  • Open the View Editor and locate the field for which you want to enable calculations.
  • Click on the field to open its settings panel.

2. Enable Calculations

  • Toggle the Enable Calculations option to “ON.”
    This activates the calculation options for the selected field.

3. Configure Calculation Data Source

  • Under Calculation Data Source, select the data set to include in the calculation:
    • Visible Entries: Includes only the entries currently visible in the view.
    • All Entries: Includes all entries in the database, regardless of visibility in the view.

4. Select Calculation Type

  • Under Calculation Type, choose the type of calculation you want to display:
    • Sum: Displays the total sum of all field values.
    • Average: Displays the average of all field values.

5. Customize the Label

  • Under Label, customize the text to display alongside the calculation result.
    • Use the placeholder {result} to represent the calculated value in the label.
      Example: Sum: {result} will display as Sum: 100.

6. Save Changes

Once configured, save the View settings to apply your changes.

That’s it! Now, check your view table, and you will see the calculation displayed in the table footer.

wpforms views calculation display

Example Use Case #

If you want to display the total sales in a table footer, you can enable calculations on the “Sales Amount” field, set the Calculation Data Source to “All Entries,” choose Calculation Type as “Sum,” and customize the label to read Total Sales: {result}.

Notes #

  • Ensure the field contains numerical data to avoid errors in calculations.
  • The calculation will be dynamically updated as entries are added or modified.