Skip to main content
All CollectionsBuild & customizeForm logic & calculations
How to calculate the estimated price using variables and logic
How to calculate the estimated price using variables and logic

This guide helps you build a dynamic estimate form where the total price is calculated in real time using logic based on user responses.

Updated today

In this tutorial, you will learn how to create a job estimation form with logic to calculate the total estimated price based on user inputs.

The form includes variables for job type, hours, number of people needed, and urgency, and each of these fields contributes to the final cost calculation.

Follow this step-by-step guide about creating an estimate form with price calculation:

Step 1: Log in to your Formaloo dashboard

Open your dashboard, or sign up for free if you don't have an account yet.

You can either create a new form from scratch or use a pre-made template like the Job estimation form and customize it to match your needs.

Step 2: Set up your form fields

Use the drag-and-drop interface to add the necessary fields to your form.

In this example, we'll include fields such as:

  • Type of service (Dropdown): List options like "Repairing" and "Cleaning.", etc.

  • Describe your service requests: A text field for users to provide more details.

  • How many hours approximately? (Number field): Allows users to input the estimated hours.

  • How many people are needed? (Number field): Users can enter the number of people required.

  • When? (Single choice): Options like "ASAP," "This week," "During this month," or "Later."

  • Total payment amount (Variable field): Add a variable field to store the total calculated price.
    This field will hold the sum of the logic-based calculations and display the final estimated price.

  • Total Payable (Content field): This will display the final estimated price using answer piping to show the value stored in the variable field.

Step 3: Add a variable field for the total payment amount

This variable field acts as a container that holds the total estimated price as it is calculated in real-time.

By assigning it an ID, you ensure that all logic calculations (such as adding or subtracting values based on the user's selections) update this field.

This way, when the form reaches the final step or displays the total price, the field will show the correct amount, making the estimation process seamless and dynamic.

  1. Add a Variable field:
    In the form editor, add a variable field that will store the total payment amount. Name this field something like "Total Payment Amount" to make it clear that this is where the final price will be calculated and stored.

  2. Assign an ID to the field:
    Give this field an ID (e.g., "total") so that you can reference it easily when applying logic.
    The ID allows the system to know where to store the calculated values based on the conditions you will set in the logic.

Step 4: Set up logic to calculate the price

  1. Open the logic tab:
    Navigate to the Logic tab to start adding conditions that will calculate the total price.

  2. Set up logic based on job type:

    • Add a condition:
      If the Type of Service is "Repairing," then add $20 to the Total payment amount.

    • Add another condition:
      If the Type of Service is "Cleaning," then add $15 to the Total payment amount.
      etc.

      add logic for price
  3. Set up logic based on hours:

    • Add a condition:
      If How many hours approximately? is greater than 1, Multiply the Total payable amount By How many hours approximately.

  4. Set up logic based on the number of people:

    • Add a condition:
      If How many people are needed? is greater than 1, Multiply the Total payable amount By How many hours approximately.

  5. Set up logic based on urgency:

    • Add a condition:
      If When? is "ASAP," add $25 to the Total payment amount.
      If When? is "This week", add 5 to the Total payment amount.

Step 5: Display the total estimated price

  1. Create a content field to display the total price:
    Add a Content field at the end or the beginning of the form where the total price will be displayed.

  2. Use answer piping to show the price:
    In the description of the section field, use the answer piping feature by inserting {{total}} or @total.
    This will automatically display the calculated price based on the logic you've set.

Final step: Preview and test your form

Once you've added all the logic and connected the payment gateway, preview your form to ensure everything works as expected.

logic and calculation

The form will now automatically calculate the total estimated price based on user inputs and allow clients to proceed to payment if needed.

Did this answer your question?