Answered

Ask the same question X number of times, based on # response


Userlevel 1
Badge

Very new to Typeform (just signed up about 15 minutes ago), but I’m creating some of my initial test forms and I am stumped on something.  

I need to as the same set of questions, based on a previous response to a “number”.   So, if the person types “3”, I need to ask the same set of questions three times, ideally with slightly different information presented (just to make the form clear).   
 

I want to ask on the form:

How many locations? 

 

Based on that response, I would like to ask:

What is the address for Location #”x”:   

Then, ask the same question over and over until we complete the number defined in the original question.  
 

I’m dating myself, but I would normally do this with a for next loop back in the day.  

Thanks for any input or help that you can provide.  

icon

Best answer by john.desborough 6 May 2021, 03:31

View original

5 replies

Userlevel 7
Badge +6

@C_W_ - welcome to the community from a fellow user

is this link here similar in concept to what you want to do??

 

let me know and i will run through the logic for you 

 

cheers

des

Userlevel 1
Badge

@john.desborough That looks like a solid start for sure!  I would love some assistance with that and I’ll see if I can tweak it further from there :-)

Userlevel 7
Badge +6

@C_W_  - here’s the basics of what was done: 

  • i created the questions (question groups) that i needed, up to the maximum number of times i wanted people to go through the cycle - in the sample above, up to 10 entries. 
    • you cannot loop back into the same question series as you will overwrite the answers from the first pass: you need to create the maximum number you want to manage in the cycle
  • i set up a series of variables to capture the number of times that the user wanted to go through the cycle, along with some others - there is an image below of the variables created for the sample above
  • based on the answer to the first question ie how many do you want to enter, i add the value of the entry to the counter variable ie 3 from your entry above
  • after the user answered the first question/question group, i subtract one from the counter variable then check to see if the variable = 0. if it does, i kick them out to the ending page, otherwise go to next question/group and repeat.

 

that is how that previous example worked

 

hope that helps you move it forward

Hello @john.desborough 

I’m currently experiencing a similar issue, only that my forms are more dynamic.

I’m building a form that has another form in it (inner form) asking the respondents to add details of other members of their team. I’ve tried the solution above to add a number limit to the number of times a form gets filled but it takes me through all (10 of them) the forms I created.

 

The number they input here determines how many times they fill in team members information

 

I think it gets complex because the respondent has to fill about 10 fields for each team member they indicate.

Team members input field is grouped like this
​​

After implementing the above solution, it still takes me to Team Members 4,5,6….


I’ll need more assistance on how to go about this or find out if this is possible to implement with Typeform. @john.desborough 

  

Userlevel 7
Badge +6

@thefundplug - yes it’s possible to implement inside typeform, using the question groups. 

by having the counter go down on the last question in each group, you can say something like this:

  • how many (max of 10) - 3
    • set counter to 3
  • logic on last question of group1 
    • set counter to counter - 1(now would be 2) 
    • if counter gt than 0 jumpto qgroup2
    • if counter = 0 jump to endpoint
  • logic on last question of group 2
    • set counter to counter - 1(now would be 1) 
    • if counter gt than 0 jumpto qgroup3
    • if counter = 0 jump to endpoint
  • logic on last question of group 3
    • set counter to counter - 1(now would be 0) 
    • if counter gt than 0 jumpto qgroup3
    • if counter = 0 jump to endpoint

this way it would not go to the 4th question group - just make sure that you have the same logic on the last question of all your question groups. 

 

des

Reply