How can I include the unselected choices from one answer as statements in the next question? | XM Community
Skip to main content

Shown below is the code I am using to split the UnselectedChoices, which are given as a descriptive text element and separated by a comma, as I need to use them one by one. Then, I set the EmbeddedData variable Unselected_1 to the first unselected choice(the first element of the newly created list, unselected[0]) and Unselected_2 to the second unselected choice.
1.png
I am using addOnPageSubmit() as my intention would be to pipe the EmbeddedData Unselected_1 in Q10(which belongs to a separate block).
2.png
However, this is not working for some reason. The only way it works is if I move the above JS to the addOnLoad() of Q10(shown in the above figure). Nonetheless, since I cannot define an embedded data and pipe it in the same block, this does not allow me to pipe Unselected_1 into question 10, which is where I need it.
I was wondering if anyone has experience this problem before and if they were able to spot the issue.
In another post, someone was saying this may be caused by the position of the EmbeddedData in the survey flow, which I don't think is the case, as I created Unselected_1 and Unselected_2 at the top of the flow, as shown below.
3.png

Two things:

  1. You can't pipe 'unselected' on the same same page as the question you are piping from. Pipes get resolved on the server before the page is sent to the client browser.

  2. Qualtrics separates strings with a comma AND a space - your split should be split(", ").

A simpler solution would be to use carryforward unselected from Q6 on Q10.


TomG Thank you for your comment!
I also thought of using carryforward. However, I do not need the unselected choices to appear in the statements(even though I erroneously said so in the question), but to appear one by one on the top of the columns in a side by side question(as shown below).
4.pngIf you know an alternative way to obtain this layout that would also be fine!


The thing that is puzzling me is why it works when I insert the JS code in Q10 and I pipe the embeddeddata in the next block, but not when I run the JS in Q6.
5.png


TomG is there another way to get the unselected choices from Q6 without piping ${q://QID8/ChoiceGroup/UnselectedChoices}?
Because I believe that is the part of the code that is not working(I cannot pipe the unselected options on the same page)


I also thought of using carryforward. However, I do not need the unselected choices to appear in the statements(even though I erroneously said so in the question), but to appear one by one on the top of the columns in a side by side question(as shown below).

A better way to do this is to include all three Q6 choices as columns in your side-by-side, then use display logic to only display the column if not selected in Q6.


That worked, thank you!
Is to your knowledge possible to set up a display logic that works on all the columns at once?


Is to your knowledge possible to set up a display logic that works on all the columns at once?

No, it is not.


Leave a Reply