Can I dynamically update question text based on previous answers?

  • Profile Image
    Passionio
    Asked on July 12, 2017 at 05:23 AM

    Hey there,

    I'd like to dynamically update question text (or a simple text field) based on an answer given by the user earlier in the form. I understand this is possible by creating a text field per possible outcome and then "hiding" and "showing" the relevant fields based on a previous answer. However - this gets very complex when you have 28 variables of answers the user can give. 

    What I'd like to do is use dynamic fields demonstrated in the basic example below:

    E.g.

    Question 1: How many Workout Routines per week? (Multiple choice 1-7)
    Question 2: Great! Please Choose: [ANSWER TO QUESTION 1] workout routines from the selection below.

    Ideally, we can even create logic such similar to how vlookup in excel works. 

    E.g.

    7 workouts per week means
    - 3 Full Body Workouts
    - 4 Cardio Workouts

    6 workouts per weeks mean.... (etc)

    So it would be:

    Question 1: How many Workout Routines per week? (Multiple choice 1-7)
    Question 2: Great! Please Choose: [X Full Body Workouts] workout routines from the selection below.
    Question 3: Great! Please Choose: [X Cardio Workouts] workout routines from the selection below. 

    Please let me know if you have any clarifying questions. Otherwise, I hope there's a solution out there!

    Thanks,
    Dan

  • Profile Image
    candy
    Answered on July 12, 2017 at 08:21 AM

    Dear Dan,

    Yes, you're able to update questions text based on previous answers, dynamically. There are many ways to do this.

    Firstly, you can use Conditional Logic as you can see in the following guide: https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic 

    Basically, you can set hidden some of the questions and you can make them appear with a conditional logic as you can see in the following guide: https://www.jotform.com/help/316-How-to-Show-or-Hide-Fields-Base-on-User-s-Answer

    Or, you can skip the pages conditionally as you can see in the following guide: https://www.jotform.com/help/350-How-to-Skip-Pages-Using-Conditional-Logic 

    I have cloned your form named "Product Builder | Influencer" on my side in order to check and test it. In your example, you can set a text field to the form and give it to the variable field names as you can see below:

    Moreover, these form fields are usable in all form fields as you can see below:

    So that, your users will see their answer in the next questions as seen below:

    I hope this helps. If you need further assistance, please let us know.

  • Profile Image
    Passionio
    Answered on July 12, 2017 at 12:30 PM

    Thanks Candy. Very useful! I will try this.

    And regarding the second part of my question:

    "Ideally, we can even create logic such similar to how vlookup in excel works. 

    E.g.

    "7 workouts per week means
    - 3 Full Body Workouts
    - 4 Cardio Workouts

    6 workouts per weeks means

    - 3 Full Body Workouts
    - 3 Cardio Workouts.... etc"

    So it would be:

    Question 1: How many Workout Routines per week? (Multiple choice 1-7)
    Question 2: Great! Please Choose: [X Full Body Workouts] workout routines from the selection below.
    Question 3: Great! Please Choose: [X Cardio Workouts] workout routines from the selection below. "

    Is this possible? Let me know if the question isn't clear!

    Many thanks,
    Dan

  • Profile Image
    AIDAN
    Answered on July 12, 2017 at 02:38 PM

    One thing to consider, is assigning calculation values to the 1-7 multiple choices element and use them in order to get at least the value that one of the workouts should have, then you can indirectly get the remaining count from the total workouts selected minus the value that you received.

    This, coupled with the conditional logic and the ability to insert text/calculation based on conditions, as demonstrated by my colleague Candy, would allow you to have, in light of your example above:

    * Multiple choice 6 would have a calculation value of 3, which you have set with the number of cardio workouts in mind, and that leaves as a result 3 as the number of full body workouts.

    * Multiple choice 7 would have a calculation value of 4, which you have set with the number of cardio workouts in mind, and that leaves as a result 3 as the number of full body workouts.

    We have a guide on how to assign calculation value here: https://www.jotform.com/help/301-How-to-Assign-Calculation-Value

    I hope this helps. If you need further assistance please let us know. Thank you.