Anyone who can help with the javascript? I need to autocode the 3rd question based from my responses in Rank Order questions. Below is the link for reference.
https://rochediacx.fra1.qualtrics.com/jfe/preview/SV_6zmQqumcohFkWa2?Q_CHL=preview&Q_SurveyVersionID=current
Autocode the next question based from the response in ranking order
Best answer by Rudi
Hi there,
this could solve your problem :-)
- create an embedded data field selectedItemsRankingQuestion
- add the below code into the JS for the ranking question
- add the below code in the ranking question
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
let inputs = document.getElementsByTagName('input')
let selectedItemsRankingQuestion = new Array;
console.log(inputs)
for(let i=0;i
selectedItemsRankingQuestion.push(inputs[i].id.split('~')[2])
}
}
console.log(selectedItemsRankingQuestion)
Qualtrics.SurveyEngine.setEmbeddedData("selectedItemsRankingQuestion", selectedItemsRankingQuestion.join(','));
});
then add this code in the multi-select question:
Qualtrics.SurveyEngine.addOnload(function()
{
let selectedItemsRanking = "${e://Field/selectedItemsRankingQuestion}".split(',')
for(let i = 0;i
}
});
note that the recodes for these two questions have to be identical respectively that the recodes of the auto coding question are identical with the last element of options' ids in the ranking question
Best regards
Rudi
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.
