ProTip: Creating Calculations and Totals

Originally published on 12/11/2015

Leverage the power of automation by automatically calculating totals with Automated Calculations

Digital forms offer numerous advantages, one of which is the capability to incorporate automation features like Automatic Calculations. By utilizing Automated Calculations, form creators can employ equations to automatically compute totals, eliminating the need for manual data entry.

Setting up this straightforward process is a quick and easy task within the Template Builder, requiring just a few steps. Before delving into the steps, let's first understand what Calculations are and how they can be seamlessly incorporated into your digital forms.

What are Automatic Calculations?

Calculations allow your fields to perform anything from simple addition or multiplication to complex Conditional Logic – directly within your form. In other words, they perform actions based on data entered into a specific form field. 

These Calculations are configured within the TemplateEditor, using the GoFormz Calculation Builder. The Calculation Builder, which can be accessed within the Properties Panel, guides form builders through the addition of calculations. Within the Calculation Builder is an index of all available functions, fields, and variables users can leverage within their form Template. As a user types a formula into the Calculation Builder’s Formula Bar, the list of available functions, fields, and variables truncates only to display those relevant to the entered formula – simplifying and streamlining the formula creation process.

 How to add Calculations to your digital form Template:

You can equip your form Template with these calculations using the Calculation Builder. Locating the Calculation Builder is easy and starts by accessing the Template Editor in GoFormz: 

  1. From the homepage, navigate to the ‘Templates’ tab and select which Template you want to edit. Once you select your Template, the GoFormz Template Editor will load. 

  2. Select the field you would like to add a Calculation to and navigate to the Properties Panel (to the right of your Template). 

  3. Locate and select the Default Value property and the Calculation Builder will load. 

  4. Within the Calculation Builder you can enter and test your Calculations. To get started, simply type a ‘=’ and options will begin to populate.

Calculating a Total with the GoFormz Calculation Builder

Calculations are frequently used within Table fields. In this example, we’ll use Calculations to find the total sum of a column in a Table field of a digital invoice form

To get started, we’ll first identify what elements need to be included in our formula. GoFormz calculations reference Table cells as [column][row]. Depending on the complexity of the calculation, you may also need to define the specific Table within the calculation string, for example, if you need to multiply a cell in one Table with a cell in another Table. Tables are defined as “[Table Name]!”.

For this example, the Table will include 4 columns and 4 rows. With the Table field selected, you will notice an additional grey column to the left of the Table and a grey row above. When selected, the Properties Panel will reflect details for that particular row or column of the Table.

Example Table: 

Column 1: Item

Column 2: Quantity

Column 3: Unit Price

Column 4: Total

To get started, open the Properties Panel for the “Totals” column by selecting the grey column header. Locate the Default Value section – this is where you will add your formulas. Select “Use Individual Values” from the drop-down, and additional rows will populate, allowing you to now set up your four-row equation.

For this equation, we’ll use the following syntax: [Quantity][1]:[Unit Price][1]

Following the same naming conventions mentioned above, the first row, Row 1, would look like this:

=IF([2][1]*[3][1]>0, [2][1]*[3][1],"") 

Now follow the same procedure for your remaining three rows, adjusting the number to reflect each specific row:

Row 2: =IF([2][2]*[3][2]>0, [2][2]*[3][2],"")

Row 3: =IF([2][3]*[3][3]>0, [2][3]*[3][3],"")

Row 4: =IF([2][4]*[3][4]>0, [2][4]*[3][4],"")

Now that we have our Table set up to calculate the total of each row, let’s calculate the grand total of the “Total Column”. To do this, set up a regular Text field below your table and access the Calculation Builder for the Default Value property within the Properties Panel. Now, add the following calculation:

=SUM([Example Table]![4][1]:[4][4])

This equation instructs your Table to sum the values in Column 4, from Rows 1 to 4 in our example Table (ProTip: don’t forget to name your Table – you’ll need to specify your Table name in your formula).

Whether it's automatically calculating totals or using digital forms for eSignature capture, GoFormz is your all-in-one solution for seamlessly enhancing your business processes. Get started with your free 14-day trial and uncover the power of digital data collection today!