Restart current loop based on conditional logic | XM Community
Skip to main content

Is there any way (with js or other) to send someone back a page in the current loop of a multi-page loop and merge block based on logic in another page in the block?

Loop and merge block setup:

  • Display 20 loops in random order based on question from previous block.
  • Back button is disabled.
  • Page 1: Video player and timing question. JavaScript on video question hides continue button until player status is ‘ended’ but a loophole exists if someone presses play on video and then drags the scrubber to the end.
  • Page 2 - Conditional: Single text/graphic question, page is only displayed if the page 1 timing question page submit is less than 20 seconds (the video duration). Warns them not to fast-forward through videos and that they can’t answer the questions unless they play the whole video. Skips to end of block to push them to page 1 of the next randomized loop. If they were on the video page for >=20 seconds this page is not displayed.
  • Page 3: Page of questions based on the page 1 video.
  • Page 4 - Conditional: Text/graphic questions with warnings if they skipped too many questions or got the attention check questions wrong, but if they answered questions as expected this page is not displayed.

What I’m hoping to do is on Page 2. Instead of using skip logic to push them into the next loop, I’d like to send them back to page 1 in the current loop so they can watch the video and then answer the questions on page 3 (because they have to answer x% of everything to get credit for their participation).

Is there any way to use js on the page 2 question so that on click/next they would reload page 1 of the current loop? 

Thank you!

The only way to do it is to enable the back button. Then you can click the back button with JS: this.clickPreviousButton();


@TomG Bummer. Enabing the Back button isn’t an option due to all the interblock logic. Oh well!


You can turn on the back button and hide it with CSS. It’s only use would be in your JS.


@TomG I had wondered about that, but when I adjusted the settings page so that the “back button - off” option was turned off (and republished), I still didn’t see a back button. I assumed it was because of the elements between blocks in survey flow, which start at the top with embedded data and then include branching at various points, including a branch into the treatment condition where the loop and merge block lives. I had seen in other threads that help responses said basically anything in survey flow would force-disable the back button -- is there something I’ve misunderstood? 


@TomG I had wondered about that, but when I adjusted the settings page so that the “back button - off” option was turned off (and republished), I still didn’t see a back button. I assumed it was because of the elements between blocks in survey flow, which start at the top with embedded data and then include branching at various points, including a branch into the treatment condition where the loop and merge block lives. I had seen in other threads that help responses said basically anything in survey flow would force-disable the back button -- is there something I’ve misunderstood? 

In Survey Options/Responses you can turn the Back Button on or off. Turn it on.

If you have the back button turned on, survey flow elements between blocks will cause the back button to be suppressed on the first page of the a block after survey flow elements. The back button will work across sequential question blocks if there is nothing between them in the survey flow.

Within a block, including a loop & merge block, the back button will work (e.g., go back to the first page of the block from the second page in block).


Leave a Reply