Calculated field in NeetoForm is a powerful widget that allows you to perform real-time calculations based on a user's form inputs. This can be incredibly useful for a variety of applications, from displaying dynamic pricing for your e-commerce form to automatically calculating quiz scores for your quiz forms.
Here are a few popular use cases:
Pricing Calculations: For forms involving product or services, calculated fields can sum up prices to provide an estimated total at checkout, giving users an e-commerce-like experience directly within the form.
Quiz Scoring: If you're conducting online quizzes or assessments, calculated fields can tally correct answers to generate a final score, making the grading process seamless.
Tax or Discount Calculation: Calculated fields can be used to automatically apply tax or discount rates based on specific criteria.
Currently, NeetoForm supports calculated fields for numerical calculations. You can use various mathematical operations (such as addition, subtraction, multiplication, division, and assignment) to define how your calculated field should work.
How to Use Calculated Fields
Add a Calculated Field by selecting it from the list of elements.
Configure the Field Settings by assigning a meaningful name like "Score" or "Price", so that it can be referred later.
Specify an initial value, if applicable, which could serve as the starting point for your calculations.
Calculated fields work in tandem with NeetoForm’s conditional logic feature. After adding the calculated field, navigate to the Conditional Logic section from the Configure tab and set up conditions for your calculated field to determine when and how its value should change based on user responses.
NeetoForm currently supports the following operations for numerical calculations via conditional logic:
Add: Adds a specified value or another field's value to the calculated field.
Subtract: Subtracts a specified value or another field's value from the calculated field.
Multiply: Multiplies the calculated field by a specified value or another field’s value.
Divide: Divides the calculated field by a specified value or another field's value.
Assign: Sets the calculated field to a specific value, regardless of its previous value.
For example, if you have a calculated field as Price, you can perform the following operations.
Add 10 to Price.
Subtract Discount from Price. (Here, Discount is another calculated field).
Multiply Price by Count. (Here, Count is a Number element).
Displaying Calculated Values
By default, calculated values are not visible to users within the form. However, you can access these values under the "Submissions" tab to review them after form completion.
Additionally, calculated fields can be integrated with a payment element, allowing you to accept dynamic payments based on real-time calculations.