Conditional logic order

  • baron28b
    Asked on December 18, 2020 at 11:41 AM

    I'm a bit confused on how conflicting conditions are handled. I read what your guide has to say but still not clear. Example: If first condition sets another field value to 1, and the second condition (same criteria) sets it to 2, which one prevails? Thank you.

  • Jimmy_D
    Replied on December 18, 2020 at 12:54 PM

    The criteria that matched last have the priority. The position of the condition or the fields doesn't matter.

    You can test this here.-

     If the first condition sets another field value to 1, and the second condition (same criteria) sets it to 2, which one prevails?

    This is not recommended since it's conflictive and cannot guarantee the order in which a user will fill your form. My recommendation is that you make your rules more specific to avoid bugs.

    If you need further assistance, you can elaborate on what you would like to achieve, and we will be glad to provide you with a solution. 

    Regards,


  • baron28b
    Replied on December 18, 2020 at 1:44 PM

    Thanks for the prompt reply, but still not clear to me.

    If the position of the condition does not matter, what do you mean with "The criteria that matched last have the priority"? Could you maybe restate it another way? In your FAQ or guide, I thought it said that the position of the conditions DOES matter.

    On a related matter, when a field is pre-populated by the URL, does it also get changed according to the existing conditions as the form is filled out?


    Thank you.


    Baron28b

  • Jimmy_D
    Replied on December 18, 2020 at 3:14 PM

    If the position of the condition does not matter, what do you mean with "The criteria that matched last have the priority"? Could you maybe restate it another way? In your FAQ or guide, I thought it said that the position of the conditions DOES matter

    I possibly misunderstood your question.

    For example, in this form.-https://form.jotform.com/203524601112034

    1608321570 5fdd0a2270722  Screenshot 10

    The value of "Calculation" should be equal to one if B is selected in #1 and 2 if K is selected in #2. 

    If I answer to #1 first and select B, the value 1 will be pass to "Calculation", if I then select K as the answer on #2 it will 1 will be replaced by two. If we reverse the order and start from #2 the first answer will be 2, and then it will be replaced by 1 when I select B as the answer on #1

    1608322444 5fdd0d8c08756 U4YFx6hx1r Screenshot 21

    Kindly get back to us with further details if my answer does not answer your concern. 

    Regards, 

    On a related matter, when a field is pre-populated by the URL, does it also get changed according to the existing conditions as the form is filled out?

    Yes, the data pass to the URL are based on the value / data present in the field.

    Regards,