GoCanvas forms can do the math for you. We have two key features available within the Form Builder that allow you to do complex mathematical functions as well as pull forward summary numbers from previous screens. These two features 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 sub totals, calculate the tax, and provide the bottom line price.
- Go to your Forms page.
- Click to Edit an existing form or Create New.
- Name your form and add a new screen.
- Hover over the screen in the App Outline and click to Loop the screen. Let's call this screen "Materials."
Add a Calculation field
- On the Materials screen, add a Short Text field and label it "Product Description."
- Drag a Number field from the palette into the middle of the screen. You can label this "Cost." Open the Field Settings for Cost and select Currency in the Style drop down.
- Add another Number field to your form. You can label this "Quantity."
- Now add a Calculation field and label it "Subtotal." Open the Field Settings and look for the Calculation section.
- Select Create Calculation. Select the Quantity field as Operator 1, the Multiplication icon, and then Cost as Operator 2.
NOTE: You will use New Operator when creating mathematical functions with fields in your form. Use a Constant to calculate a function with a constant (static) number. You can use multiple fields and constants in a single calculation field.
Add a Summary Field
You can use a Summary field to summarize values in a looped screen. This is how you would use a Summary field:
- Add a new screen to your form and name it "Order Summary."
- Drag a Summary field from the palette into the form. You can label this "Product Total."
- Open the Field Settings for the Summary field. Select the Summary Screen. This is the screen that contains the information you are pulling from. Next select the Summary Entry. This is the field that you are pulling information from. In this example, the Summary Screen is "Materials" and the Summary Entry is "Total."
Here is an example of calculations and summary fields on a mobile device. On the Materials screen below, the item total is calculated by multiplying Qty by Price.
On the next screen, the Materials Total and Labor Total are summarized, and the Tax and Grand Total are calculated.
In a number field, users have the option to set the number of decimal places available in the field. If the style is set to currency, the decimal will automatically be set to 2 decimal places. If the style is set to number, however, you can choose how many decimal places will be allowed by opening the More tab in the palette and changing the decimal places field. Your options are no limit, or from 0-6.
Watch this video for a brief walkthrough and overview of Calculation and Summary fields: