Using the New Builder?
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 Loop Screen
- Edit an existing form or Create New from the Forms page.
- Name your form, i.e. "Sales Order," and add a new screen.
- Hover over the screen in the Form Outline and click the circling arrow icon to loop the screen. Let's call this screen "Materials."
Add a Calculation Field
- 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.
- 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.
- 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. 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.
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.
- Add a new screen to your form and name it "Order Summary."
- Drag a Summary field from the palette into the form. Label this "Product Total." Select the field to open field settings.
- 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.
- Expand Summary Field. This is the field that the summary field will summarize. In this example, the summary field is "Subtotal."
Calculations on Mobile
Here is how the example above looks on mobile.
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.
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.