I'm working on an order form which requires users to enter the quantity of an item and its price. The form calculates the price per item using ITEMTOTAL=QTY*PRICE. But I would like to allow users to order multiple items, ideally using the repeatable section feature, and have a subtotal that is the sum of all the items -- something like SUM(ITEMTOTAL).
Right now, I'm working around this by not using the repeatable section feature and just using ITEMONE, ITEMTWO, ITEMTHREE, and so on. But this is not optimal.
How can I calculate the sum of multiple repeating calculated fields? I have a basic understanding of JavaScript but don't code. Thank you in advance for any assistance.
My form is at http://app.formassembly.com/forms/view/42877.
Unfortunately recurring fields aren't currently supported with form calculations. There are plans to have variables represented in a recurring field automatically represent the total of every copy of that field. Unfortunately, it's a feature that is still waiting to be implemented.
This feature has been implemented. Formulas will now total variables properly within their own context ( repeated section ), while using the repeated variable outside the repeated section will give the sum of the instances of the variable.
As an example: http://www.tfaforms.com/143595
Contains three fields which are also variables within a repeated section: Price, Units, and Subtotal
Subtotal is also a formula field: Price*Units
Entering Price:2, Units: 1 will result in: Price: 2 Units: 1 SubTotal: 2
Adding another section with Price:4, Units: 2 will results in: Price: 4 Units: 2 SubTotal: 8
For a form that looks like:
Price: 2 Units: 1 SubTotal: 2
Price: 4 Units: 2 SubTotal: 8
Adding a grand total field outside of the repeating sections, with the formula: SubTotal results in: GrandTotal: 10