Let’s say Q1 choices are A, B, C, and D and they are displayed in randomized order. How can I pipe the first choice that appeared in Q1 to the next question?
Solved
How can I pipe the first answer choice displayed from a previous question?
Best answer by vgayraud
Hi,
Add this code to your question’s custom javascript:
Qualtrics.SurveyEngine.addOnReady(function () {
function getChoiceTextByKey(input, key = 'x') {
if (
input &&
typeof input === 'object' &&
input.Choices &&
input.Choices[key] &&
typeof input.Choices[key].Text === 'string'
) {
return input.Choices[key].Text;
}
return null;
}
const question = this.getQuestionInfo();
const displayedFirst = getChoiceTextByKey(question, this.getChoices()[0]);
Qualtrics.SurveyEngine.setJSEmbeddedData('displayedFirst', displayedFirst);
});
With the ED “__js_displayedFirst” at the beginning of your survey flow:

Pipe in the value of that ED in subsequent questions with “${e://Field/__js_displayedFirst}”
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
