Pipe in several selected choices separately in a question text | XM Community
Skip to main content
Solved

Pipe in several selected choices separately in a question text

  • November 16, 2021
  • 5 replies
  • 520 views

Forum|alt.badge.img+5

I have a question whereby respondents select 2 options. I would then like to pipe the two options they choose into the text of the next question:
Question 23:
image.pngQuestion 24:
'How is a {1st object} related to a {2nd object}?'

Is there a way to do this?
Many thanks,
Ben

Best answer by TomG

https://community.qualtrics.com/XMcommunity/discussion/comment/41899#Comment_41899You have to edit your question in HTML View. You don't need to change the JS.

5 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • November 16, 2021

Set up Q24 like:
How is related to a ?
Then JS:
Qualtrics.SurveyEngine.addOnload(function() {
var pipes = "${/*pipe for selected Q23 choices goes here*/}".split(", ");
jQuery("#"+this.questionId+" .pipe").each(function(i) { jQuery(this).html(pipes[i]); });
});


Forum|alt.badge.img+5
  • Author
  • Level 1 ●
  • November 16, 2021

Thank you very much, Tom,
I've never used JS on Qualtrics, where can I found out more about how to implement your code? (for dummies!) E.g. the ' ' remains when I copy it into my question... Do I need to change any of the JS for my survey?
Best,
Ben


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • November 16, 2021

https://community.qualtrics.com/XMcommunity/discussion/comment/41899#Comment_41899You have to edit your question in HTML View. You don't need to change the JS.


MSobotta
Level 4 ●●●●
Forum|alt.badge.img+25
  • Level 4 ●●●●
  • November 18, 2021

Without JS you can do so with lots of Branch Logic. If you don't need them separated you could do:
How are ${q://QID87/ChoiceGroup/SelectedChoices} related?


Forum|alt.badge.img+5
  • Author
  • Level 1 ●
  • February 21, 2022

https://community.qualtrics.com/XMcommunity/discussion/comment/41898#Comment_41898Is there a way to do this when you have two sets of responses?
I.e. from a matrix table? Pipe in each 'yes' response and each 'no' response separately? (not as a list of each group)