How to automate Product List element Calculations?

  • Marlika_Harris
    Asked on March 31, 2025 at 9:38 AM

    Dear JotForm Support Team,

    I am setting up a form that requires the payment widget to dynamically calculate the total amount due based on user selections. Specifically, I need assistance configuring the widget to automatically update the quantity field based on the following inputs:

    • Number of Guests
    • Number of Nights Stayed
    • Rate: Cost per Person, Per Night

    The goal is for the form to automatically multiply the number of guests by the number of nights and apply this value as the quantity in the payment widget. This way, the total cost is calculated without requiring the user to manually enter the quantity.

    Could you please guide me on the best way to achieve this functionality within JotForm? If any custom calculations or conditions are required, I’d appreciate step-by-step instructions on how to set them up.

    Looking forward to your guidance.

    Best regards,

    Marlika Harris

    Jotform Thread 25746351 Screenshot
  • Jenette_R JotForm Support
    Replied on March 31, 2025 at 10:46 AM

    Hi Marlika,

    Thanks for reaching out to Jotform Support. I’ll need a bit of time to look into this. I’ll get back to you as soon as I can.

    Thanks for your patience and understanding, we appreciate it.

  • Jenette_R JotForm Support
    Replied on March 31, 2025 at 12:10 PM

    Hi Marlika,

    When I clone your ISPSO AM2025 On-Campus Accommodations form, I can see the Payment Type is set to Sell Product. To clarify, you would like to multiply the number of guest and night, and you would also like to add the price from the Product List element. Unfortunately, if your Payment Type is Sell Product, it isn't currently possible. As a workaround, I suggest changing the Payment Type to User Defined Amount. Let me show you how:

    1. In Form Builder, click on Product List element.

    2. Then, click on Card icon to open the Payment Properties.

    3. Under Payment Type, click on drop down menu and select User Defined Amount.

    4. In the window that opens, click Yes, Change.

    How to automate Product List element Calculations? Image 1 Screenshot 80 Changing the Payment Type will remove the product in the Product List. To fix this, you can add two Single Choice element for the product name and quantity. Here's how:

    1.  In Form Builder, click on the Add Element menu on the left side of the screen.

    2. In the menu on the left, under the Basic Elements menu, drag and drop a Single Choice element.

    How to automate Product List element Calculations? Image 2 Screenshot 91 After adding both element, you need to enable the Calculation Values and add the price per night. Let me show you how:

    1. In Form Builder, click on Single Choice element.

    2. Click on Gear icon, in the menu on the right side that opens up, click on Options tab.

    3. Now, Enter each option on a new line. (In my test, I add, 1,2,3,4,5).

    4. Toggle Calculation Values to ON position and add the prices for each night. (In my test, I add 59,118,177,236,295).

    How to automate Product List element Calculations? Image 3 Screenshot 102 After that, you will need to add a Form Calculation Widget to multiply the number of guest by number of nights. Here's how to do it:

    1. In Form Builder and click on Add Element on the upper-left side of the page.

    2. Click on the Widgets tab, click on the Form Calculation widget to add it to your form.

    How to automate Product List element Calculations? Image 4 Screenshot 113 3. Then, set the formula like you see below and click on Save button. 

    How to automate Product List element Calculations? Image 5 Screenshot 124

    Additionally, you need to change the Get Price From None (Manual) to Form Calculation in Payment Fields. Let me show you how:

    1. In Form Builder, click on Payment Field.

    2. Then click on User Define Amount icon.

    3. In the window that opens, in the dropdown menu under Get Price From click Form Calculation:

    How to automate Product List element Calculations? Image 6 Screenshot 135 Check out my screencast to see my result:

    How to automate Product List element Calculations? Image 7 Screenshot 146 You can a test my clone form here. We also have a guide on How to clone a form.

    Give it a try and reach out again if you have any other questions.

Your Answer