Randomization and Display Logic Questions | XM Community
Skip to main content

I’m working on a survey where we would like to mix display logic and randomization. I understand that mixing display/skip logic and randomization within a block are not allowed using the default randomization.

 

Ideally, what we’d like to do is randomly show one of 2 follow-up items, depending how someone answered a preceding rating item. The rating item has a 5 point Strongly Agree to Strongly Disagree scale. If they answer Strongly Disagree or Disagree, we’d like to show a follow-up item to 50% of participants (we don’t want everyone answering it). So basically, it’s randomly showing a follow-up to a subset of people depending how they answer the rating item. It would be ideal if this could be done within the block. If the item order needs to be changed, we can likely put this at the end.

 

Is this possible with JavaScript or anything else? I haven’t found a clear answer and we don’t have a ton of time to come up with a solution.

I think this would work...

Using advanced randomization, force the follow-up question to be the last question in the block. Set the randomization to show one question per page.

In the rating question use JS within the addOnPageSubmit function to set an embedded data field based on the strong disagree/disagree rating and then randomly about half the respondents that fall in that classification.

Use the embedded data field mentioned above in display logic for the follow-up question. 


I think this would work...

Using advanced randomization, force the follow-up question to be the last question in the block. Set the randomization to show one question per page.

In the rating question use JS within the addOnPageSubmit function to set an embedded data field based on the strong disagree/disagree rating and then randomly about half the respondents that fall in that classification.

Use the embedded data field mentioned above in display logic for the follow-up question. 

 

Thank you. I should have included this but we need to show more than 1 question per page. It’s a large survey so we typically include ~15-20 questions per page. Do you think there’s another approach?


You would still make the follow-up question last. You can still use JS, but it will be more complex. Use a click handler instead of addOnPageSubmit and hide/show the last question as needed. If there are multiple pages it gets even more complex because you’ll  need to support it being on the same page or a different page.


Leave a Reply