Skip to main content

Is there a recursion detection that stops infinite loops from happening?

 

Warning - long, complicated post ahead:

I have a survey where the logic is something like this: Choose a,b,c,d,e,etc... if ‘a’ is chosen, jump to dropdown 1 and answer the next 5 dropdowns after it. On the last dropdown (dropdown 5) there is a logic statement that sends you back to the choose a,b,c,d... slide. Then you have to pick a different option which will bring you to a new dropdown set. I want this to occur three times and then when the variable that I’m incrementing becomes 3, I end the survey by jumping to the last slide.

The problem is that this is failing after it jumps back to the choose a,b,c… slide for the second time. Instead of jumping to the second set of dropdowns, it jumps to the last slide.

I’ve tested this using a much simpler setup with two slides looped together, and it looks like there’s either a bug or some kind of recursion check because they stop looping after the second time as seen above.

I would duplicate dropdowns and make it sequential with no logic jumps needed, but the problem is that I have a huge survey with 300 separate dropdowns with ~50 choices each. If I don’t use the logic jumps I’ll have to copy those 300 dropdown slides 2 times over again, and I don’t think typeform can handle that as it’s already lagging as it (I also don’t think I can handle it haha).

Obviously some kind of dynamic dropdown would be the solution here, where the dropdown options are filled depending on a previous selection. But no survey creation site offers this, including typeform.

@Dirk Diggler - welcome to the community from a fellow user.. 

the issue you seem to be having is similar to one that I wanted to use for creating a typeform to order tshirts (choose a quote, pick a size and how many of that quote/size combination, then order a second or a third) 

The issue is this: when you loop back to the ‘first question’ in  your cycle, without submitting the form, you overwrite the choices that you made previously. Ie first pass - you choose q1a, q2c, q3d (then set your loop_variable_count to 1) then send the user back to q1 - you are going to replace your choice for q1 with the new choice. variables may also be reset as well.. hence your counter issues

so you have to find a workaround for the ‘loop back logic’ 

for me, I created three separate question sets and used a yes/no (do you want to order a 2nd or a 3rd tshirt, depending on where they were in the process) that would send them to the next sequence. I tested the loop back logic capability with folks from Typeform in an Office Hours session and that was the solution that we had to come up with. 

You may be able to break  your typeform down into a series of typeforms and pass details between them using hidden fields. This might be the way to solve the issue of lagging - very long surveys are going to have that sort of issue - breaking it down into smaller bits might help there as well. 

for example:

  • if you break first loop through the dropdowns into typeform 1 (tf1) and then when you want to send them into the second loop, you redirect on completion (with all the fields you want to pass to the second loop) to tf2
  • in tf2, you set up the hidden fields so that you can receive the data coming from tf1 AND you can evaluate the choice in the a,b,c,d, etc starting question by putting in a statement question just after that handles the “if hidden_field_answer is xxxxxx AND tf2-q1 is xxxxx, then go to the statement question and tell them they have made a duplicate selection and they need to change” - the statement question takes them back to tf2-q1 to make a ‘different’ selection and then go to tf2_q2
  • repeat for your third pass as well

duplicating your typeform would create the multiple copies of your dropdowns quickly in this multi-form scenario

to connect the data at the back end in this scenario, you could easily connect the initial typeform to a Google Sheet and then all the smaller typeforms to the same google sheet - they would show up as separate tabs in that sheet. You could then use an identifier like email, for example, passed between forms as a hidden field to be the key field on which to relate all the data across the tabs. 

just a thought on a Saturday morning without the benefit of coffee #3… 

cheers

 

des


@john.desborough, thank you very much for the reply.

I am aware that the jump back resets previous answers like you explained above. I should have been clearer in my original post, but the way I have it setup is choose a,b,c,d if ‘a’ goto dropdown 1, on dropdown 5 loop back to choose a,b,c,d. If ‘b’ goto dropdown 6, and on dropdown 10 loop back to choose a,b,c,d. If ‘c’ goto dropdown 11, and on dropdown 15 loop back to choose a,b,c,d.

So each option (a,b,c,d) does have a unique set of questions that will not be overwritten. It’s also set up where the user will not need to select the same choice twice, i.e. choose ‘a’ on the first and second run.

I also noticed what you are talking about with the counter issues, I think this is what’s causing me pain here. I’ve tried playing around with where the variable increments to no avail.

 

Saying all that, it might just not be possible. I think your method of getting rid of this loop back logic is the best path. I was not aware that you can connect multiple typeforms together. That’s an AWESOME solution, especially because I can have everything copy over and I won’t bog down the current typeform with another 600 questions like you said.

Thank you!


@Dirk Diggler - good to hear.. i think you will still have a problem in your primary pathing if you loop back to your ‘abcde’ page  - your previous choice, say q1=a, will be overwritten by q1=b if that is the choice that the user makes in the second loop - regardless of the fact that you send them to unique follow-on dropdowns.  at the end of the process, when you hit submit, the last q1=?? will be what is entered into the system and that will be the pathing/answer results you capture.. 

on the counter solution, i put together a short demo/test that asks how many times you want to enter something ie 1-10, and i pass the user through the number of question based on incrementing the counter at the end of the question .. i’ve also tested this on question groups as well.. 

 

good luck on the implementation !

 

des


Reply