Answered

Using logic to present different question groups

  • 15 November 2023
  • 2 replies
  • 59 views

I have a registration form for a sports class. Within the form, using a Multiple Choice question, I ask parents how many students they would like to register, with possible answers ranging from one to five. I require an answer and allow only a single choice. I then have five question groups created -- one for each of the possible answers to my Multiple Choice question concerning the number of students to be registered. Within each question group I present the appropriate quantity of name and birthdate fields, along with a concluding Agreement field. I have created logic for the Multiple Choice question, so that depending upon the answer, the user is then directed to the appropriate question group.

The logic works as follows:

IF “How many students would you like to register” is “One” THEN go to “Register One Student Only.”

I repeat this for each of the five possible answers.

The problem I am having is this:

Suppose the user selects “One” for the number of students he wishes to register. He is then taken to the correct question group and eventually the Agreement question, which should conclude the exercise by having a “Submit” control. But instead, he is then presented with question groups two through five.

Clearly I am doing something wrong, but having now watched multiple videos, I am still not figuring out the solution. I would be grateful for any guidance.

Thank you.

 

 

icon

Best answer by john.desborough 16 November 2023, 03:43

View original

2 replies

Userlevel 7
Badge +6

@johnharris - there are a couple of ways to process this - using X number of question groups or potentially using a second typeform that provides the ability for a infinite loop of entries (last question on the second form is “want to add another?” - if they answer yes redirect on submission to the same form, passing some hidden field values in the url). 

 

for the first instance, you have to add logic on the LAST question in each question group that takes the initial counter variable you set with the answer to the number of registrations and reduces it by one, if it is greater than 0 then go to the next question group.. otherwise go to the end. if they go to the next question group, then the same counter reduction, evaluation vs 0 and routing has to take place. 

that’s a common ‘oversight’ people make. 

 

there are a number of posts here in the Community on how to do this - but if you can’t find one, i created a cheat sheet that walks you through the logic for these two approaches. you can find it here

 

des

 

I appreciate your kind reply, Mr. Desborough. I think I would benefit from your cheat seat and will get a copy.

Reply