Can I use the same field as a part of the same calculation within a condition?

  • jayhobbs21
    Asked on December 9, 2017 at 5:43 PM
    Additionally, I am having trouble increment a field up multiple times.  I seem to get an endless loop/freeze when I try to use conditional logic like: Filed A +1 = Field A.  I see that seems to be an issue ( https://www.jotform.com/answers/1203558-Is-there-a-way-to-increment-a-number-field-based-on-conditional-logic ).  Is this resolved?
  • Support_Management Jotform Support
    Replied on December 9, 2017 at 6:28 PM

    The thread you posted was not an issue that needs to be resolved per se. It was a query/question by someone who also managed to find a solution for his problem himself.

    From how he phrased it, he managed to get around the idea by using the Form Calculation Widget. Since the post was a bit old, we can't tell for sure if he's requirement is the same as yours.

    From how I understood it, here's what you want to happen:

    IF something is TRUE, THEN add 1 to FIELD A and post that result to that same FIELD A

    This would indeed cause a loop in the condition since you're using the same field as both the trigger the result.

    One way around this is to use CALCULATION VALUES if you will be triggering the increment through a field that supports calculation values.

    Calculation Values can be assigned to the following fields:

    🔘 Dropdowns

    🔘 Single Choice (radio buttons)

    🔘 Multiple Choice (checkboxes)

    Related guide: How-to-Assign-Calculation-Value

    The idea is to assign a value of 1 to specific fields which in turn will be used in conjunction with a Form Calculation Widget. To give a rough example, have a look at this form: https://www.jotform.com/73427272043957

    That form doesn't use conditions - It only uses the assigned calculation values for each of those 3 checkboxes. Then the Form Calculation Widget simply tallies the total.