Using Calculation and Summary Fields in the Legacy Builder

Have more questions? Submit a request

Using GoCanvas to automate calculations and summarizing values is a great tool to save time and reduce errors. 

Calculation and Summary

GoCanvas forms can do the math for you. We have two key field types available within the Legacy Builder that automatically compute simple mathematical functions as well as summarize all instances of a number or calculation field in a Loop Screen. These two field are called Calculation and Summary.

Let's build a simple sales order form, where a sales person could sell a product and have GoCanvas break out the subtotals, calculate the tax, and provide the bottom line price.

Add a Loop Screen

  1. Edit an existing form or Create New from the Forms page.
  2. Name your form, i.e. "Sales Order," and add a new screen.
  3. Hover over the screen in the Form Outline and click the circling arrow icon to loop the screen. Let's call this screen "Materials."
AFB_Loop_a_Screen_Materials.png

Add a Calculation Field

  1. On the Materials screen, add a Drop Down field and label it "Product Description." This field can be powered by Reference Data to make it easier for users to fill out the form with accurate product descriptions.
  2. Add a Number field to the internal screen of the loop. You can label this "Cost." Select the field to open the Field Settings and select Currency in the Style drop down.
    AFB_Number_Style_Currency.png
  3. Add another Number field to your form. You can label this "Quantity."
  4. Now add a Calculation field and label it "Subtotal." Open the Field Settings and look for the Calculation section.
    AFB_Create_Calculation.png
  5. Select Create Calculation. Leave the Cost field as Operator 1 and Quantity as Operator 2. Hover over the Addition icon in the center and the four operator options will expand. Select Multiplication. 
    AFB_Create_Calculation_Multiplication.png

Note

Use New Operator to add another value to the calculation, either field values or constants. Constant calculates a function with a static number. You can use multiple fields and constants in a single calculation field. However, calculation fields do not follow the Order of Operations so be sure to structure your calculations to follow these rules to get the correct answer.

Add a Summary Field

Summary fields are used exclusively to summarize number or calculation fields located in loop screens. Regardless of the amount of rows in the loop screen, this field will add every value together to give a total on a later screen.

  1. Add a new screen to your form and name it "Order Summary."
  2. Drag a Summary field from the palette into the form. Label this "Product Total." Select the field to open field settings.
  3. Expand the Summary Screen drop down. This is the screen where the field is located that needs to be summarized. The outer part of the loop screen is named after the key field, whereas the inner part of the loop screen is labelled "Materials." Therefore, the summary screen will be named "Product Description," not "Materials" for this example.
  4. Expand Summary Field. This is the field that the summary field will summarize. In this example, the summary field is "Subtotal."
AFB_Summary_Field_Settings.png

Calculations on Mobile

Here is how the example above looks on mobile.

iOS_Sales_Order_Example_Loop_Screen.gif
iOS_Sales_Order_Example_Summary_Screen.jpg

Note

The loop screen above is in the style of Grid and this option can be found in the Loop Screen Settings.

Decimal Settings

Both calculation and number fields have a setting to determine the amount of decimals that will be included in the calculation. If the style or format is set to currency, the field will automatically be set to 2 decimal places. If the style or format is set to number, the options for decimal places are no limit (number only), or from 0-6. This setting lives under the More drop down for both calculation and number fields but also under the Format tab in the Calculation modal for calculation fields.

Calculation Number
LB_Calculation_More_Decimal Places.png
LB_Calculation_Format_Number_Decimal Places.png
AFB_Number_Decimal options.png

Did we answer your question?

We'd really appreciate your feedback! Please leave your suggestions for improvement in the comments or let us know what you're looking for so we can assist you better. We want to help, but we need to understand your needs!

Articles in this section

Share

Comments

0 comments

Please sign in to leave a comment.