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
- Edit an existing form or Create New from the Forms page.
- Name your form, i.e. "Sales Order," and select Add Table.
- Let's label this table "Materials."
Add a Calculation Field
- On the Materials screen, select the gear icon for the Key Field to open Field Settings.
- 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.
- 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.
- Add another Number field to your form and label it "Quantity."
- Now add a Calculation field and label it "Subtotal." Select + Add Calculation.
- 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.
- 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.
- Add a new screen to your form and name it "Order Summary."
- Drag a Calculation field from the field library into the form. Label this "Product Total" and open the field settings modal.
- Toggle to the Table Calculation radio button on the Calculation tab.
- 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."
- Expand the Column drop down. This is the field that will be summarized. In this example, select "Subtotal."
- Expand the Format drop down and select Currency.
- Select Done to save changes and close the modal.
Calculations on Mobile
Here is how the example above looks on mobile.
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.
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!
Comments
0 commentsPlease sign in to leave a comment.