How to Calculate Values for Multiple Choice Checkbox Fields

  • rwaldenjr
    Asked on June 29, 2020 at 8:36 PM

    I have a multiple checkbox element in my Create An Account form. JotForm's conditional logic choices don't include the basic "or" operator. So, I'm forced to find a work-around to change my Thank-you message based on multiple checkboxes selected; not just one each like I've already programmed. I think I can accomplish what I'm trying to do using form calculations!?!

    I've assigned each checkbox field aa number, "1". And, the Form Calculator widget should be able to calculate an If/Then statement, as follows:

         IF the number calculated is greater than 2, THEN use a custom Thank-you message.

    Sounds simple enough. The problem is that the Form Calculator widget doesn't see the individual checkbox fields! It only sees the multiple choice element as a unit, "Group(s) You Wish to Join:".  Have I configured the multiple choice fields incorrectly? They're visible in the Conditional Logic statements that I've already created. Is there some other way to accomplish what I'm trying to do?

    Thanks for your help! 

    Jotform Thread 2419633 Screenshot
  • David JotForm Support Manager
    Replied on June 29, 2020 at 11:25 PM

    Hi, thank you for contacting us. Please note that changing your Thank-you message based on multiple checkboxes selected is not possible.

    Only one Thank You message can be displayed, and if you want to have a different Thank You message, the conditions would conflict each other when the user selects more than one option:

    1593487410options Screenshot 10

    You would need to limit the selection to one. Let us know if you need more help.

  • rwaldenjr
    Replied on June 30, 2020 at 1:28 PM

    Thanks for your response BDavid -

    However, I'm not sure you understood my question, and I'm confused by your answers. I beg to differ with your first statement, "changing your Thank-you message based on multiple checkboxes selected is not possible". I've already created six different Thank-you messages which are each triggered by Conditions I've set for selecting any single multiple choice option.

    What I wanted to do was create a similar Condition where when more than one multiple choice option is selected, that triggers a seventh version of my Thank-you message. [The conditional statement would read, "IF any two or more checkboxes are selected, THEN (a particular version of) the Thank-you message is displayed".] Finding a way to tally the number of checkboxes selected is my question.

    With full conditional logic programming (which doesn't seem to be available with JotForm), there would be an option to use "or" and "and/or" operators. JotForm seems to only offer the "and" operator, which means I would have to write 15 different permutations of my six multi-choice options to achieve the desired effect.

    The Form Calculator widget that your colleage suggested seems to be a much more efficient way to go. But, this Help Guide article only describes the configuration process for radio buttons, even though it indicates that the same process can be used for both multi-choice and drop-down fields as well. I've successfully assigned values to each multi-choice option. But, the widget doesn't seem to see the individual fields within the "Group(s) You Wish To Join:" element to tally them (unless I'm missing a configuration setting somewhere)!?! That's odd because JotForm's Conditional Logic sees those same fields.

    What's the procedure for using this widget (or any other method) to calculate the values of multiple choice fields that the user selects?

  • David JotForm Support Manager
    Replied on June 30, 2020 at 3:32 PM

    What I meant to say is that only one Thank You message will show up, regardless of how many groups I select. For example, if I select:

    Seller

    Investor

    And Home Buyer

    It is not possible to display these 3 messages:

    1593544499messages Screenshot 10

     

    Only one will show up:

    1593544563thankyoumessage Screenshot 21

    If you would like to display a message that reads:

    "Welcome to the Seller, Investor, Home Buyer group(s).

    Please enjoy the group's benefits and services."

    You could try a single condition like this:

    1593545497condition 001 Screenshot 32

    Result:

    1593545522thankyoumessage2 Screenshot 43

    Hope this helps.

  • rwaldenjr
    Replied on June 30, 2020 at 3:51 PM

    Brilliant, BDavid! That's exactly what I've been looking for. (Ask enough people, you eventually get the right answer.  LoL  ) 

    So if I understand you correctly, the default "{groupsYou}" selector that I keep seeing in my Emails template is a global variable that lists all selections made by the user on this multi-choice element?

  • Niko_N
    Replied on June 30, 2020 at 6:33 PM

    Greetings,

    Yes, you are right. Every element has it's own unique name that can be used for string interpolation, which is displaying values that are held by a given element (like selection made by a user on the multiple-choice element). You can find/modify the corresponding unique names from form properties:

    How to Calculate Values for Multiple Choice Checkbox Fields Image 1 Screenshot 30

    How to Calculate Values for Multiple Choice Checkbox Fields Image 2 Screenshot 41

    You simply need to wrap that name inside curly braces like "{groupsYou}" and if you use it in Email/Autoresponder email templates or in Thank You page, it will be automatically replaced with a string representation of values held by that field.

    I hope this helps.

    Please let us know if you have any further questions.

    Thank you in advance!

  • rwaldenjr
    Replied on June 30, 2020 at 8:19 PM

    Great explanation Niko! Between you and BDavid's last explanation, I'm off to the races.....

    Thanks!
        :-)

  • rwaldenjr
    Replied on July 1, 2020 at 12:56 AM

    Btw, we solved my problem through other means. But for future reference, we never did answer my original question about "How to calculate values for multiple choice checkbox fields" when those fields are given values. As I stated earlier, the Form Calculator widget doesn't see the individual fields in my form.

  • Anita_K
    Replied on July 1, 2020 at 5:24 AM

    Hi,

    we are glad to hear that you were able to create a workaround. I apologize that we have missed your question.

    With the multiple-choice field you can set calculation values under the Options tab:

    How to Calculate Values for Multiple Choice Checkbox Fields Image 1 Screenshot 30

    Then you can add the field into a Form Calculation Widget and it will automatically add the calculation values of the fields selected.

    How to Calculate Values for Multiple Choice Checkbox Fields Image 2 Screenshot 41

    If you would like to count how many options are selected, you can assign a calculation value of 1 for each field. Then you can apply conditions to the calculation field.

    I hope this helps, please let us know if you have any further questions.

  • rwaldenjr
    Replied on July 2, 2020 at 2:48 PM

    Anita -

    Thanks for your explanation. I was able to add calculation values of "1" for each field of the element fairly easily. What's not clear in your response, in the Help Guides or in the widget documentation is how to identify what the Form Calcuation Widget is supposed to tally!?! The widget's configuration window only sees the element as a whole, and not is fields.

    In the screenshot example you attached, does the single instance of "Type a question 0-9" cover all four checkbox fields in the "Type a Question" form element? My inclination would be to specify four iterations of something to count in the widget (one each possibly), to match the four fields in the element.

  • David JotForm Support Manager
    Replied on July 2, 2020 at 4:18 PM

    Hi, it adds up the assigned values of all the existing options in a Multiple Choice field, example:

    1593721020addup Screenshot 10

  • rwaldenjr
    Replied on July 2, 2020 at 4:27 PM

    Okay, that's not explained anywhere that I've read, BDavid! But, you cleared up my question. So thanks! That's a great feaure! I'm sure I'll use it at some point down the road, now that I know how it works....

    Btw, excellent video tutorial! Please have your Help Guide team add it to the documentation for the Form Calculator widget. I'm sure I'm not the only user who was confused about how to configure it.

    Thanks again, and stay safe,

           :-)

  • Niko_N
    Replied on July 2, 2020 at 5:44 PM

    Hello,

    We are happy that your question has been cleared up by my colleague's answer.

    Thanks for your feedback about our guide, I'll forward your request to the relevant colleagues to add documentation such video tutorials that will help the users avoid confusion.

    Please let us know if you will have any further questions.

    Thank you!