Using Calculation and Table Calculation in the 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 allow you to do complex mathematical functions as well as pull forward summary numbers from previous screens. 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 Table

  1. Edit an existing form or Create New from the Forms page.
  2. Name your form, i.e. "Sales Order," and select Add Table.Builder_Add Table.png
  3. Let's label this table "Materials."

Add a Calculation Field

  1. On the Materials screen, select the gear icon for the Key Field to open Field Settings.Builder_Key Field_Gear Icon.png
  2. Expand the Field Type drop down and select Single Choice. This field can be powered by Reference Data to make it easier for users to fill out the form with accurate product descriptions.Builder_Table_Key Field Settings_Single Choice.png
  3. Add a Number field to the table and label it "Cost." Select the gear icon to open the Field Settings modal and select the Currency radio button under Style.Builder_Number Field Settings_Style_Currency.png
  4. Add another Number field to your form and label it "Quantity."
  5. Now add a Calculation field and label it "Subtotal." Select + Add Calculation.Builder_Table_Calculation Field_Add Calculation.png
  6. On the Calculation tab, expand the first drop down and select "Cost," expand the second drop down and select "Quantity." Click the Addition sign and choose Multiplication. Finally, expand the Format drop down and select Currency at the bottom of the drop down menu.Builder_Calculation_Cost x Quantity_Subtotal.png
  7. Select Done to save changes and close the modal.

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 Table Calculation

Table Calculation fields are used exclusively to summarize number or calculation fields located in a table. Regardless of the amount of rows in the table, 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 Calculation field from the field library into the form. Label this "Product Total" and open the field settings modal.
  3. Toggle to the Table Calculation radio button on the Calculation tab.
  4. Under Sum up values in..., expand the Table drop down. This is the table where the field is located that needs to be summarized. In this case, select "Materials."
  5. Expand the Column drop down. This is the field that will be summarized. In this example, select "Subtotal."
  6. Expand the Format drop down and select Currency.Builder_Table_Calculation.png
  7. Select Done to save changes and close the modal.

 

Calculations on Mobile

Here is how the example above looks on mobile.

iOS_Sales_Order_Example_Loop_Screen.gifiOS_Sales_Order_Example_Summary_Screen.jpg

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 on the More tab for both calculation and number fields but also under the Format drop down on the Calculation tab for calculation fields.

Calculation Number
Builder_Calculation_Number_More_Decimal Places.pngBuilder_Calculation_Format_Number_Decimal Places.png

Did we answer your question?

Please let us know by voting below. All we ask is if you downvote, please let us know how the content can be improved in the comments!

Articles in this section

Was this article helpful?
0 out of 0 found this helpful
Share

Comments

0 comments

Please sign in to leave a comment.