How to randomly display only one choice from a set of unselected choices from the previous question? | XM Community
Skip to main content

I would like Qualtrics to randomly select a choice from a set of unselected choices from the previous question.

For example, the first question respondants need to answer is “Which country do you support” with an option to choose one from a list of 21 choices (Algeria, Australia, … , United Kingdom). This is easy to set up and I have done this. 

The second question I am hoping to ask the respondant is “What do you think of the current government in XXX”. I would like one of the unselected countries from question 1 to appear in the place of “XXX”. However, I want the selection of unselected country to be random.

So for example, if a person selects “Germany” from the dropdown menu in question 1, then I want the question “What do you think of the current government in Algeria” to appear, where “Algeria” has been randomly selected by the computer out of possible 20 unselected choices of countries. 

How would I go about doing this? This seems not possible with using piped text.

Thank you.

Hi @hw637 I am sure this could be possible with Javascript but without it is the solution below.

STEP 1: Create both these questions in a separate block.

STEP 2: Build this logic in the survey flow.

Below the country question we will create branches which will flag the selected choices based on the embedded data. Do it for the rest of the choices as well. See image below.
NOTE: You can name the embedded data and its value as per your choice.

STEP 3: 

Insert a randomizer which will pick the unselected choices randomly but it will require the following branch logics to get working on i.e., it will check if the embedded data value is empty for that particular choice and if yes then it will be assigned for the ‘random choice’ embedded data which will be later on piped in the second question. Repeat this for all the choices, see image below.

STEP 4: Then add the second question block at the bottom.

STEP 5: Pipe text the embedded data in the question text.

 END!

This could prove to be lengthy in your case as there are 21 countries but on the same hand it is easy to understand.
Hope it works for you.


Leave a Reply