Calculating Values and Constants

Have more questions? Submit a request

GoCanvas has the ability to perform simple mathematical operations automatically, helping to eliminate calculation errors and save you time.

Calculation Fields

GoCanvas can complete simple mathematical operations using values collected and calculated in the submission or constant values. A common example that we are all familiar with is calculating the subtotal of a purchase and the subsequent tax on that purchase.

Calculating with Field Values

First, we must determine the subtotal. For this example, we will use two Number fields and one Calculation field.

  1. Add two Number fields and one Calculation field to the form using your preferred method.
  2. Label the first number field, "Quantity," label the second number field, "Unit Price," and label the calculation field, "Subtotal."
  3. Select the "Unit Price" field in the center workspace to open Field Settings in the left panel, expand the Style drop down in the Field Settings, and select Currency at the end of the menu.
  4. Select the "Subtotal" field in the center workspace, under Calculation in the Field Settings, expand the first drop down and select "Quantity."
  5. Click the Multiplication symbol to change the operator.
  6. Expand the second drop down and select "Unit Price."
  7. In the Standard menu above, expand the Format drop down, and select Currency at the end of the menu.
Builder_Calculating Subtotal Example.png

The Total field will automatically multiply the Quantity and Unit Price fields once there are values captured in the submission. 

You can add as many fields as necessary to achieve your end result. Simply click + Add Value to add more fields and/or constants to the calculation. 

Please Note

Calculation fields do not follow PEMDAS so in order to get the correct answer, be sure to build you calculations following these rules.

Calculating Fields with Constants

Next, we will use a constant value to determine the how much tax needs to be charged on the subtotal calculated above.

For example, if the same tax rate of 6% applies to all of your billable items, you can add a constant of 0.06 and multiply it with your Subtotal field. 

  1. Add a Calculation field to the form and label it "Tax."
  2. In the Field Settings, expand the Format drop down, and select Currency at the end of the menu.
  3. Under Calculation in the Field Settings, expand the first drop down and select "Subtotal."
  4. Click the Multiplication symbol to change the operator.
  5. Move your cursor to the second value field and type the decimal form of your percentage, i.e. 6% = 0.06 for this example, and enter.
Builder_Calculating Tax Example.gif

You can use multiple fields and constants in a single calculation field, keeping in mind proper order of operations. When in doubt, simplify the calculations to guarantee the correct result.

To get the grand total of your item total plus tax, you'll simply set up one more calculation field adding those two fields together.

Save and Test your calculations to be sure they work as expected, either from within the Builder or Publish to test on mobile.

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.