Calculated field updated with wrong value

  • stormingrobots
    Asked on February 15, 2019 at 9:26 AM

    See form  90085865384164

    - I entered 5 in the # of Members.

    - select any "league"

    - Error is: the # of team members field kept being changed back displaying the "2" no matter what I enter, anyway.

    see this: 

    1550240532pic1 Screenshot 10


    See the criteria (which I have disabled for now)

    1550240604pic2 Screenshot 21

    but it never really (it seems) as it kept changed back to "2" - the default. 


    here is the criteria:

    1550240631pic3 Screenshot 32

  • stormingrobots
    Replied on February 15, 2019 at 9:37 AM

    2nd problem which I think they may very well be propagated from same or similar issue .

    to replicate 2nd issue: 

    - select any league, such as soccer

    - change # of members : 4 or 3 or 2

    - members entries show up properly

    - error is:  change # of members : 5.  member 3 and member 4 entries  are not hidden.  However, in the criteria, I clearly selected to hide only member 5 entry.  Some bug in the "Hide Multiple"?

  • BJoanna
    Replied on February 15, 2019 at 12:01 PM

    Regarding the first issue - The condition you disabled is not set properly. You should use the same field in IF and DO state because it can create a loop. 

    1550249502loop Screenshot 10

    Regarding the second issue - Only Member1 and Member2 fields are shown because of your conditions #3 and #4. They are set to show member 3, 4, and 5. So if the league is not equal to one of the "OnStage" options they will stay hidden.

    1550249823condition1 Screenshot 21

    You have to fix your conditions and make sure that there aren't any conflicts between them. 

  • stormingrobots
    Replied on February 15, 2019 at 2:51 PM

    "... The condition you disabled is not set properly. You should use the same field in IF and DO state because it can create a loop. .."

    1) I think you mean it creates a conflict logic , but not a loop (as if it repeats like a loop structure.) No way that they should recreate a loop!  

    Besides, it is changed to "4"... i.e. NOT >4 ..  Therefore, it  is totally logical.  Grammatically, or even semantically, it is a 100% sound logic.  However, I would imagine depending on how you implement this in your backend code.  Nevetheless, when I write my own form, this can easily be done via javascript. My point is that this should be acceptable to as it is similar to do : if (x >4 )  set x = 4 .  

    To make matter worse though, your backend code changed it back to "2". Now, that's totally incorrect.

    2) sorry,, I do not agree to your assessment. 

    The criterias  said 

      if  league == onstage  "AND"  # of members == 5

           show member 3 , 4, and 5

    The issue I mentioned is the opposite...    I said, the member 3, 4, and 5 got hidden instead; unless you saying your backend code would do the opposite to "show" simply because the criteria does not match.  That really does not make sense.. I hope not!

    To further clarify:

    I choose league == any league other than onstage, e.g. soccer,   "AND"   # of members == 5. 

    It should just hide member 5, not  hide member 3, 4, and 5 !?

  • Richie JotForm Support
    Replied on February 15, 2019 at 4:17 PM

    I have checked your conditions and you have disabled the calculation members. This fixes the issue on getting the value back to  default.

    Calculated field updated with wrong value Image 1 Screenshot 30

    Regarding your second question, you're using "ALL" and not "AND" in the statement. If "ALL" IF statements are correct then the condition will  run.

    Calculated field updated with wrong value Image 2 Screenshot 41

    However, if you use "ANY", then any of the IF statement will trigger the condition.

    Please give it a try and let us know how it goes.

  • stormingrobots
    Replied on February 15, 2019 at 9:11 PM

    issue 1) :  I disabled it on purpose because if I enabled it, it would force the # of members displaying "2" no matter what.  Since this form has gone live, I cannot allow this to continue. Thus, I disabled it. If I enabled it, the # of members will constantly display "2" even when I changed it to 3, 4, or 5. 


    issue 2) unless I misunderstand you or you had a typo, your suggestion is not correct .. 

    "ALL"  of the "If' Rules are matched ==  means "And" relationship.   It means both the criteria must be true in order for the condition to run.   This is exactly what I wanted.  I wanted 

    if league =  Onstage AND # of members == 5 

         show member 3, 4, and 5.


    Anyhow, that is again not what I am asking for.. I am saying...

    I choose league not = onStage,   "AND"  if  # of members == 5.    


                It should just hide member 5, not  hide member 3, 4, and 5 !?

    1550283015pic4 Screenshot 10




  • AndrewHag
    Replied on February 16, 2019 at 2:40 AM

    Please disable the previous condition and create it again, instead of Hiding the 5th field, set the condition to Show Multiple and show 3rd and 4th fields.

    1550302689chrome VTwpi9yYhh Screenshot 10

    1550302716chrome IyYbTLGN2C Screenshot 21

    Here is the result:

    1550302750chrome Zc59Tgo8uO Screenshot 32

    Do let us know if you still face any issues.

  • stormingrobots
    Replied on February 16, 2019 at 9:57 AM

    to AndrewHag:   that's a clever and simple workaround. Sounds good. Thank you. 

    however, the issue #1 still there... i did further experiment with an extra field - overMaxCheck. Again, I had to disable this criteria because it now always changes the # of Members to  2 all the time.  

    See the following:

    1550328731junk Screenshot 10

  • Victoria_K
    Replied on February 16, 2019 at 1:56 PM

    I was reviewing your form and conditions and it seems that there can be a conditional conflict. 

    At JotForm conditions work this way: If there is 1 statement to show the field, that field will be only shown if the condition is met. If condition is not met, the field must be always hidden. There are several conditions to show/hide same fields, so at the moment, the case is which condition will be met/not met first in every particular case. 

    I can suggest to check if you can reduce number of duplicates in order to have only unique cases to show every field/set of fields:

    Calculated field updated with wrong value Image 1 Screenshot 20

  • stormingrobots
    Replied on February 16, 2019 at 8:30 PM

    To Victoria,  I do agree I probably should create a state machine criteria for this.  The list of criteria were created in a hurry but I do intend to clean it up later to create states. 

    However, none of these should contribute to the "#of members". These conditions that you have mentioned are all affecting show/hide the member entries. None will show /hide "# of members", nor change "# of members". 


  • roneet
    Replied on February 16, 2019 at 11:10 PM

    Currently, you have set a default value of #No of Members as 2. Could you please clarify further your requirement that how do you want to implement the League and #member combination so that we can further check.

    Thanks.