Is there some way to populate multiple check boxes for a question field based on previous responses?

  • Profile Image
    SOSStLucia
    Asked on August 13, 2017 at 06:58 PM

    I am trying to create a check list of supporting documents that a user needs to present with an application form based on their responses to previous questions.  For example, If a user selects "Yes" from a drop down when asked "Are you married", then the Supporting documents List should check the option for "Marriage certificate".

    I tried creating the conditions for this using the update/calculate conditions but it seems that it only allows one selection, whereas, I need it to select multiple checkboxes.

  • Profile Image
    jonathan
    Answered on August 13, 2017 at 08:10 PM

    You can achieve this using the Assign Value feature of the Dropdown list and Calculate conditions.

    Example:

     

    You can test my form https://form.jotformpro.com/72247293278969

    It work like this:

     

    Let us know if you need further assistance.

     

     

  • Profile Image
    SOSStLucia
    Answered on August 14, 2017 at 05:43 PM
    Ok so the question for my field is phrased like this:
    "I am...." with a dropdown with 3 options:
    Drop-down option 1: Single
    Drop-down option 2:Married
    Drop-down option 3: Divorced
    A single person does not need to provide any supporting documents. A
    married woman must present a marriage certificate, but it is not
    required for a man. A divorced woman must present a divorce certificate
    (if her name has changed as a result of the divorce). A divorced man is
    not required to present anything.
    So how should I enter the calculation values? Can I enter them as 3
    rows like this?
    no value
    Marriage Certificate
    Divorce Certificate
    So no condition would be created for the single person, a condition
    created for a person who is married and a woman and another created for
    a divorced person who is a woman. Am I on the rigt track?
    ...
  • Profile Image
    jonathan
    Answered on August 14, 2017 at 06:13 PM

    The trick is to assign calculation value (surveying option) in Dropdown list to the value of the Checkboxes.

    Ex:

     

    You can test my form again https://www.jotformpro.com/72247293278969

     

  • Profile Image
    SOSStLucia
    Answered on August 14, 2017 at 06:43 PM
    I see that your form works for selecting one of the items in the
    checklist. For my purposes, I need to select multiple options from the
    field called supporting documents. Four options are pre-selected
    because they are mandatory for all applicants. However, when I set
    conditions to select the others, in the end, only one box is checked at
    a time.
    ...
  • Profile Image
    jonathan
    Answered on August 14, 2017 at 07:01 PM

     I need to select multiple options from the field called supporting documents. 

    What is this field? Is it a Checkbox field?

    You can also use Conditions to populate multiple checkboxes base on the answer from Dropdown.

    Ex:

     

  • Profile Image
    jonathan
    Answered on August 14, 2017 at 07:03 PM

    An alternative you may also want to check if creating conditions is too complicated is to use the Dynamic Dropdown widget.

    https://widgets.jotform.com/widget/dynamic_dropdowns

     

     

  • Profile Image
    SOSStLucia
    Answered on August 14, 2017 at 07:43 PM
    The supporting documents field is a check box field. This is exactly
    what I am trying to do (i.e. I am trying to populate/check from the list
    of supporting documents, those that apply to the particular applicant)
    The previous fields that would determine what checkboxes (Supporting
    documents field) are to be checked are mostly drop down fields but some
    are short text fields (calculated fields). For example I have a field
    which calculates the expiry days for a passport based on the expiry
    date.
    Thanks,
    Kayle
    ...
  • Profile Image
    Kevin_G
    Answered on August 14, 2017 at 08:31 PM

    Based on your explanation, using basic drop down fields will work for you as the widgets will not perform the calculations. 

    You would need to follow the instructions provided above by my colleague, here is also a guide that will help you with the show/hide conditions: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    I would also recommend you to check this guide in order to know how to assign a calculation value, this way you could set values based on the selected option in a drop down: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value 

    This guide will also help you performing the calculations on your form: https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget 

    For example I have a field

    which calculates the expiry days for a passport based on the expiry

    date. 

    I would recommend you to take a look on the following widget: https://widgets.jotform.com/widget/dates_difference 

    The result of that widget can be used in calculations. 

    I hope this helps. 

  • Profile Image
    SOSStLucia
    Answered on August 14, 2017 at 10:05 PM

    Hi Kevin G,

     

    Thank you for your response.  This is what I am trying to do:

    I want to automatically update or populate  a multiple check box field called "Supporting documents" based on a users previous responses. Most of these previous responses are in the form of drop down fields, but some fields like the "Current passport Expiry Time (days)" is not a drop down field.  It is a short text calculation field (that works fine) and is based on the current date and the expiry date.  The problem is, the conditions that I have been trying to in order to to populate the "Supporting documents" check boxes have been failing.

     

    My responses to your comments are in blue:

    "You would need to follow the instructions provided above by my colleague,.."

    I have followed his instructions and the issue still exists.  The only thing I have not tried yet is the dynamic drop-down widget.  I'm still reading about it and am not yet sure how it can be applied to issue I'm trying to address.

    For example the first suggestion was to use the assign value feature of the drop-down list and I have followed the instructions but it has not solved the problem.  See below with my screenshots:

    step1: See drop down options for the "I am" field: Married Single divorced

    Step2:  If the applicant is a married woman, then a marriage certificate must be selected presented as a supporting document.  Based on the instructions, I have updated the Calculation values/Surveying with 4 rows of values with each value on a new line.  The first value is 0 and will be used for the empty option (because) it is a dropdown):

    0 (for empty option)

    Marriage Certificate (for married women only)

    No Value (because single persons need not provide anything)

    Divorce Certificate (for married women only)

    See screenshot below:

    Next, based on the first set of instructions provided, I created the condition to pre-populate or check the "Supporting documents" check box field with "Marriage Certificate (Women only)" if the field "I am" is filled and the "Sex/Gender" field is equal to female.  See screenshot:

    So based on my understanding (and if I have followed the instructions correctly), The field called "Supporting documents which contains the checkbox called "Marriage Certificate (Women only)" should be automatically checked when the applicant is a woman who is married.  This is not happening.  

    You would need to follow the instructions provided above by my colleague, here is also a guide that will help you with the show/hide conditions: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer 

    I have read this guide and I have many show/hide conditions that work fine.  I don't need to show or hide a field.  I need to automatically select/check particular checkboxes within a field, based on previous responses.  

    I would also recommend you to check this guide in order to know how to assign a calculation value, this way you could set values based on the selected option in a drop down: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value 

    I have also read this several times and it is possible that I am missing something.  I hope that after reviewing my screenshots above, you can tell me where  have gone wrong.

    This guide will also help you performing the calculations on your form: https://www.jotform.com/help/259-How-to-Perform-Form-Calculation-Using-a-Widget 

    I have also read this and used the tool before for other calculations that are working fine.  

    For example I have a field

    which calculates the expiry days for a passport based on the expiry

    date. 

     

    I would recommend you to take a look on the following widget: https://widgets.jotform.com/widget/dates_difference 

    I have used the widget tool for exactly that purpose and it is working fine.  This is not the issue I am trying to fix.

    I hope I've better explained what I am trying to do.  I appreciate the help.

     

    Thanks

     

  • Profile Image
    EltonCris
    Answered on August 15, 2017 at 12:02 AM

    Our apologies for the confusion.

    From what I've understood, you want to populate multiple check box options based on the fields answer. I'm not quite sure if multiple options can be populated through conditions but let me conduct some tests and get back to you with updates.

    Stay in touch!

  • Profile Image
    EltonCris
    Answered on August 15, 2017 at 12:19 AM

    Good news! Based on my test, it is possible to populate multiple options on a check box field. To do that, you have to separate the options with a comma in the calculation field.

    So here's what you need to do.

    1. First, you need to modify your condition like the following (see visual guide)

    a. In the second if rule, select Married

    b. Select Calculate field's value

    c. Paste the options that you want to populate separated by a comma. You can copy the text options below.

    d. Save

    Here's the text options to populate the Marriage Certificate along with the default selected options.

    Birth Certificate,Passport Photos,Picture I.D.,Passport Application Form,Marriage Certificate (Women Only)

     

    2. For the Divorce, you can clone the same condition and replace only the last option Marriage Certificate (Women Only) with Divorce Certificate like the following.

    Birth Certificate,Passport Photos,Picture I.D.,Passport Application Form,Divorce Certificate

    Here's a visual guide:

    Demo: https://form.jotformpro.com/72259039842967

    If you need further assistance, let us know.

  • Profile Image
    SOSStLucia
    Answered on August 15, 2017 at 12:43 AM
    Thank you.
    ...
  • Profile Image
    SOSStLucia
    Answered on August 15, 2017 at 01:16 AM

    Hi EltonCris,

     

    Thank you for this.  I tried your suggestion.  I first created the condition for married women just as you presented it.  I then tried to add a second condition.  This one is for people born outside the country.  The corresponding supporting document is a Citizenship document.  I then tested as an applicant (woman, married, born outside the country).  It checked the citizenship document checkbox along with the other mandatory documents, but the Marriage certificate (Women only) was unchecked.  

    So basically it is the same issue as before; one condition overrides the other, so instead of checking any additional options that arise based on added conditions, it replaces with the results of the new condition.

    Your suggestion could work if I had fewer options in the Supporting documents field.  However, I have 14 documents (checkbox options) of which only 4 are mandatory.  I would basically need to create a condition for every possible scenario and that is simply not feasible given the many variables and potential combinations of documents.

  • Profile Image
    Charlie
    Answered on August 15, 2017 at 04:19 AM

    Hi,

    The problem is that we are trying to dynamically change the check box list (Supporting Documents) based on different cases. I've created a sample form for this. Here it is:

    https://form.jotformpro.com/72262085055958 

    Don't mind the words "Doc#" and "All Docs" for now. Try filling out the first three fields then check the "Support Documents" at the bottom which is a check box list. Is that the behavior you are expecting? If so, here's how my solution works:

    1. First, I will setup Text Boxes / "Short Text Entry" fields, they will represent each document in your supporting documents check box. 

     

    2. Now what are these text boxes? These will act as container for the exact words in your supporting documents when the conditions are meant. 

    Example:

    I will insert the word "Citizenship Document" in "Doc2" text box IF the user selects "Yes" in the "Are you a citizen?" queston. 

     

    Note the diversity of my questions, I'm using a drop down field, a date field and a radio button field. The main point is to fill out the text boxes IF the conditions are met. Then you need to use the exact words in your supporting documents on these text boxes. 

    Here's another example:

     

    Now I presume you already have a good knowledge on how to insert values on text boxes, you can also use the "Assign Calculation Values" to make things easier.

     

    3. Next is that we will add the "All Docs" field, this is a Form Calculation widget

     

    4. What's the purpose of this field? We want to collate or get ALL the value in the "Doc#" text boxes. Below is how I added them in that widget:

    Important:

    - Add all of the "Doc#" text boxes here.

    - Separate them each by a comma

    - Make sure to set the input type value to "A-Z", you can do that by simply selecting it, by default its "0-9", click on it to change it to "A-Z".

     

    5. Now what we want to do is to use a conditional logic to insert the values in "All Docs" to our "Support Documents" check box list. Here's how it is setup:

     

    Now regardless of the changes you are making on the options or questions you have, the check box list will dynamically change. You can test my form and see if this is the behavior you wanted, if you wanted to have a copy of my form on your account, you can clone my form by following this guide: https://www.jotform.com/help/42-How-to-Clone-an-Existing-Form-from-a-URL 

     

    I won't go on detail on how the "Doc#" works, I presume you are already familiar on how you can insert values on text boxes. If my explanation is quite blurry or confusing, please let us know. Basically, what we are trying to do is:

    1. Add text boxes ("Doc#") that will store a confirmatory text.

    2. Create condition to fill out these text boxes.

    3. Use a form calculation widget to collect all values on these text boxes.

    4. Create a condition to insert the value of the form calculation widget on the "Support Documents" check box list. 

     

    I hope that helps. 

  • Profile Image
    SOSStLucia
    Answered on August 15, 2017 at 09:40 AM

    This works! Yaye!  THANK YOU!

    I tested it out with 4 conditions before continuing to create the other conditions.  Just one little snag that I can't seem to figure out.  I have created a condition to insert the word "Birth Certificate" in the field 1-BC (Condition#5).  (See screenshot below Although the conditions have been met, it does not insert anything in the field 1-BC.  I am wondering if Condition#4 might is overriding it.  See screenshot below:

  • Profile Image
    Kiran
    Answered on August 15, 2017 at 10:39 AM

    This seems to be a long thread. Please allow me some time to check on this or check with our colleague Charlie to see if he can help.

    Thank you for your patience. 

  • Profile Image
    Charlie
    Answered on August 16, 2017 at 02:24 AM

    Hi there!

    Upon checking your updated form, the problem is that you are using an address field for the drop down field "Country of Birth". The address field does not work properly in the case you want it to be, what you did is you remove all other parts of the address field and only use the country. 

    What I suggest is to use the regular drop down field AND use the predefined option to automatically list the countries. Here's what I meant:

     

    Now to resolve the issue, replace that field with a regular drop down field, here's how I did mine:

    1. Drag and drop the "Dropdown" under the "Form Elements" list. 

     

    2. Open the properties window of that field, navigate to the "Options" tab, then set the "Predefined Options" to "Countries" so that you don't need list the countries in the list of options. 

     

    3. To set a default, navigate to the "Advanced" tab and there you can see that the countries are already listed. 

     

    4. You then need to update all the conditions using the previous "Country of Birth" field to this new field. 

    Here's my cloned form with the changes above, you can see I have two "Country of Birth", the conditions are associated with the one labeled "Country of Birth (regular dropdown)": https://form.jotformpro.com/72270705655962 

     

    Let us know if that works.

  • Profile Image
    SOSStLucia
    Answered on August 16, 2017 at 07:24 AM

    Hi Charlie,

     

    Thank you for this.  Before making the recommended changes, I tested out your cloned form.  While the word 'Birth Certificate' did appear as it should based on the condition set in COndition#5,  the word Citizenship Document did NOT appear (as it should) so I am still wondering if there is a conflict between Condition#4 and Condition 5 as they both use 'Country of birth" as the source or input field for the calculation/update.

     

    Thanks

     

     

  • Profile Image
    Jan
    Answered on August 16, 2017 at 09:34 AM

    Are you referring to the cloned form created by Charlie? I have checked it and the Condition 4 & 5 is different from what you described.

    Upon checking the cloned form, I can see that the condition created for the "Country of Birth (regular drop down)" is configured correctly. I cloned that form and removed the other fields in order to test the condition properly. Here's a screen capture:

    As you can see, upon changing the Country of Birth (regular drop down), the field in 2-CD updated to "Citizen Document".

    Please try the suggestions made by Charlie and let us know if there are any issues.

    Hope that helps. Thank you.

  • Profile Image
    SOSStLucia
    Answered on August 16, 2017 at 02:52 PM

    My bad.  I now realize I updated the wrong "country of birth" field.  My bad.  Charlie's form works perfectly.  I will try the recommendations and let you know how it goes.

  • Profile Image
    SOSStLucia
    Answered on August 16, 2017 at 06:09 PM

    THANK YOU THANK YOU THANK YOU TO ALL WHO ASSISTED  IT IS BEHAVING AS IT SHOULD.  THIS REALLY IS AN AMAZING TOOL.

  • Profile Image
    Charlie
    Answered on August 17, 2017 at 02:20 AM

    You are most welcome. I'm glad the suggested solution is now working for you :)

    If you encounter any problems again or if you need any help, feel free to open a new thread here in the forum. Also, if you are collecting sensitive information, please do check our Terms of Use page to make sure you do not violate anything. 

    Thank you.