Pipe random selection of text, conditional on previous response | XM Community
Skip to main content

Hi, I'm wondering if there's a way to randomly select text from a list, and pipe it into a question based on an earlier response.
In quesiton 1, respondents choose a category: fruit, cars, clothes.
In question 2, respondents are asked for their opinion about an object. Based on their response to Q1, I would like to randomly select an object from a list of objects that I have for each category, and pipe it into Q2. Example:
Q1 response: fruit
fruit list (not shown to respondents): apple, banana, peach, pineapple
Q2: "How much does one apple cost at your local supermarket?"
Thanks for any ideas?

Yes, you can do this using randomizers in your survey flow.
If you will be presenting the two questions on different pages, then you would put them on different blocks and use a combination of question-based logic + randomizer + embedded data to set the value of the object. For example in the image below, if they select Fruit Q1 (in the Default Question Block) then they branched to a randomizer that assigns one of 4 fruit values. Then in the next block, the "Fruit" question is asked as "How much does one ${e://Field/RandomFruit} cost in your supermarket?" so that the randomly assigned value for fruit is pulled into the question.
image.png
If you need the questions to appear together on the same block or on the same page as in-page display logic, then you would need to assign random values for all the potential selections (Fruits, Cars, Clothes) prior to them actually making a selection, and then pulling the values in as needed. So in that case, there's no branching, and all three of the randomizers are set earlier in the flow so that the values are available to this question set.


Leave a Reply