How to randomly select 3 items without replacement, and embed them in different survey stages? | XM Community
Solved

How to randomly select 3 items without replacement, and embed them in different survey stages?

  • 26 June 2020
  • 5 replies
  • 106 views

Badge

I want to randomly select 3 images out of 100+ images, and embed them in different questions throughout the survey. It is crucial that every single respondent will not see the same image twice (randomizing without replacement), for example, respondent A can see images 1, 2, 3 but not images 1, 1, 2. What is the best way to do this? the number of questions after each image varies (and is actually conditioned on other questions previously answered using display logic).

icon

Best answer by rondev 26 June 2020, 22:57

View original

5 replies

Userlevel 7
Badge +22

Same post here

Badge

https://www.qualtrics.com/community/discussion/comment/27257#Comment_27257thanks rondev , not exactly though. I would like to take each of these images and embed them in different places in the survey individually (not as 3 images)

Userlevel 7
Badge +22

The JS written here, stores the image url into three different embedded data i.e. firstPicture, secondPicture, thirdPicture. Then you just need to pipe these embedded data into the img tag src as ->

Make sure you declare those three embedded data in the survey flow at the very start of flow.

Badge

https://www.qualtrics.com/community/discussion/comment/27259#Comment_27259thanks!!

Badge

rondev or SurajK do you know how I can view each of the variables (firstPicture, secondPicture...) when I export my dataset? I created three embedded data variables with those names, but they don't record which image each respondent was assigned (they just appear as blank variables).

Leave a Reply