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?
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}”
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
