Calculate condition of a field is being used by another field on the form

  • Jamellarmour
    Asked on November 30, 2020 at 9:55 AM

    https://form.jotform.com/202016965187155 I'm trying to set for my form to calculate inputs, when I use the conditions settings I see that it is using the formula from the field 3 to calculate a total for field 4 instead of the formula for field 4 to use its own formula that I've configured for field 4. Is there a glitch that's causing this?

  • Mike_G JotForm Support
    Replied on November 30, 2020 at 11:07 AM

    We will be glad to help you with your concern. To my understanding, you are referring to these fields in your form..

    1606749729 5fc50e21d3c32 zt201130 102138 Screenshot 10

    I see that the fields show based on the result in the first field in your form. I also noticed that each field has the same number of options and each option has a separate condition linked to it. Another thing that I confirmed is that the result of the calculation for each field is being passed over to the same "Total:" field.

    Is the issue you are reporting happens when a respondent updates the input made on the first field? If that is the case, can you check if it will be resolved when you change the Clear Hidden Field Values settings of your form from "Clear on Submit" to "Clear On Being Hidden", please?

    1606750443 5fc510eb13690 zt201130 103326 Screenshot 21

    Otherwise, please do not hesitate to let us know. Please give us more details also regarding the issue you are having. You can give us a sample calculation that shows the issue you are having. You can also include a screenshot in your reply by following the instructions in this guide — https://www.jotform.com/help/438-How-to-Post-Screenshots-to-Our-Support-Forum

  • Jamellarmour
    Replied on November 30, 2020 at 12:00 PM

    It happens when I fill in the input for What are the locations for this Shuttle Service?: the first time. If the distance in field 1 is greater than 5 miles field 4 displays, if it's less than 5miles field 3 displays. The amount of miles that the distance widget calculates is supposed to get copied into the total field. When I disable the conditions for field 3 it works correct, but when field 3 is enabled, it uses the formula for field 3 to calculate the total for field 4, then when I select the "Three Services Pass" option then select the "Daily Service Pass" option it calculates the correct total. My computer doesn't allow me to screenshot for some reason so I just tried to thoroughly explain it more.

  • Mike_G JotForm Support
    Replied on November 30, 2020 at 4:33 PM

    May I suggest that you try changing the Clear Hidden Field Values settings of your form to Clear On Being Hidden, please? This way, when fields #3 or #4 are hidden conditionally, the fields will be cleared of your respondent's selections.

    And then, to avoid any possible conflict, perhaps you can update each condition associated with those fields respectively.

    For example:

    1606771810 5fc564626eca6 zt201130 162841 Screenshot 10

    The condition above will be triggered when changes are made to field #3. You will have to do this on every condition for field #3's options. And then the same goes for field #4.

    Please give it a try and let us know if you need any further assistance.

  • Jamellarmour
    Replied on November 30, 2020 at 5:57 PM

    I tried it, it works when the distance is filled in, the locations that are more than five miles apart triggers field 4 to display, and it calculates fine but when I click the "Add A Round Trip" option it uses the formula from field 3 which gives a false calculation. If I disable field 3 there's no problem at all but for some reason it glitches to calculate based on the formula for field 3, what's making it do that?

  • Mike_G JotForm Support
    Replied on November 30, 2020 at 7:22 PM

    Apologies for any inconvenience. May I ask that you try fixing or removing all the conditions in your form with missing values

    1606782077 5fc58c7d2e696 zt201130 191806 Screenshot 10

    or Missing Field indicator to see if that would help solve the issue you are having, please?

    1606782124 5fc58cacb2a2b zt201130 192132 Screenshot 21

    Otherwise, may we ask that you provide us the details of the calculations that you need to take place in your form when your respondents fill it out, please?

    Feel free to let us know if you need any further assistance.

  • Jamellarmour
    Replied on December 1, 2020 at 6:58 PM

    The conditions were removed that had missing fields but it's still using the formula for field 3 to calculate a total for field for. The formula for field 3 is so the USD "Total" will remain 5 USD if the distance is less than 5 miles. The formula for field 4 is for if the distance is more than 5 miles, it calculates a total based on the amount of miles from the distance widget, the amount of miles is the amount of USD "Total". When I put in Akron Ohio to Medina Ohio it is 23 miles away so the Total should be 23 USD but its displaying 5 USD instead. Is there a way to fix that?

  • Vick_W Jotform Support
    Replied on December 1, 2020 at 10:16 PM

    Hi there,

    I'm looking into this for you and will get back to you shortly.

    Thanks.

  • Vick_W Jotform Support
    Replied on December 1, 2020 at 10:42 PM

    The formula for field 4 is for if the distance is more than 5 miles, it calculates a total based on the amount of miles from the distance widget, the amount of miles is the amount of USD "Total". When I put in Akron Ohio to Medina Ohio it is 23 miles away so the Total should be 23 USD but its displaying 5 USD instead. Is there a way to fix that?

    The above is already set up properly. The reason you are unable to see the 23 is that the conditions require an action by the user to get triggered. For the field "Which pass do you prefer?: and Which pass do you prefer?/:" please do not select any option by default. Keep it empty as shown below. Let the user select the type of pass they need and it will trigger the condition as well. This will show the correct amount in the Total field.

    1606879536 5fc7093089904  Screenshot 10

    You can check it on the cloned form below.

    https://www.jotform.com/203358234618961

    Let us know if you have any questions or concerns.

    Thanks.

  • Jamellarmour
    Replied on December 2, 2020 at 9:25 AM

    Ok it works correctly, thank you for your time.