How to randomize set of blocks based on answer choice | XM Community
Skip to main content

Hi,
I'd like to randomly present 1 of 4 blocks based on whether someone selected one of the 4 block topics at a previous question. For example:
Question: "Which of these products do you like"
Choices: A, B, C, D
If someone selected A or C at that question, later I'd like to randomly present either the block about A or the block about B. Is there a way to do this easily? I tried adding a branch with the condition of "if selected A or B or C or D" randomly present 1 of 4 blocks... but of course, it's randomly showing me any of the 4 blocks (for example, I selected A or B and it shows me block D because it's randomized).
Has anyone done something like this?
Thank you in advance!

I think you want to put the branching in a different place in the flow.
Either you want to put a randomizer that presents 1 of the 4 BRANCHES (each of which has logic that determines if the blocks under them should appear) eg
image.pngOr you want to have separate branches for possible response scenario, with the pertinent applicable blocks duplicated within randomizers within them:
image.pngThe first way is probably more straightforward based on what you have described, but I provided both since I'm not sure if there are other factors at play in your use case.


Hi Carol!
Edit: I thought I had answered a while back, but my message was sitting in drafts.
Thank you! There was a huge caveat I didn't mention initially: my choice list looks more like "A, B, C, D, E, F, G" and only "A, B, C, D" have corresponding question blocks.
What I wanted to happen was that if someone selected any combination that includes A, B,C, or D, OR a single instance of one of the trigger options (A, B, C, or D), they'd randomly see one corresponding question block. The way that I had my logic and flow set up, I was getting a random block assigned as long as the selection included one or more trigger options, but not if I selected one single option or if it was a combination of trigger option + non-trigger option (e.g., A + G).
I finally reached out to Qualtrics support and a very helpful agent (Joe) explained I'd have to use grouping. What this accomplishes is that participants are either shown the block that corresponds to their answer choice (if they selected a trigger option or a trigger option + non trigger option) OR randomly shows them one corresponding block if they selected multiple trigger options. In the end, each participant sees one block and the block that they see corresponds to how they answered that trigger question. Here's the solution below if anyone else runs into this issue.
1) Single randomizer that shows all 4 elements split into groups (each group corresponds to a trigger answer).
Qualtrics advanced randomization 1.PNG
2) Before the randomizer, there's embedded data to flag whether a block has been shown.
Qualtrics advanced randomization 2.PNG
3) How each group is set up. Technically each group is presented to participants, but they have to meet the conditions to see it. The branch at the beginning of the group with the 'shown-block' embedded data checks to see if block has already been shown as well as if they should be seeing the block at all. At the end of the block, 'shown block' is set to 'true' so they don't see any other blocks after that.
Qualtrics advanced randomization- selectively randomizing answer choices and combinations.PNG
Each group follows the exact same format.
This ended up working exactly like I needed it to. As long as someone selected a trigger option, they'd be shown a block. If they select more than one trigger option, they only see one block randomly. If they select a single trigger option, they see the corresponding block-- and finally, if they don't select any trigger options, they don't see any core blocks.


Leave a Reply