Hi,
since I'm quite new to JS (and especially to JS in Qualtrics), I'm struggling with the following task:
When the page unloads, I want to do some custom calculation and save the result in an embedded data field. Since the calculation is rather complex, I can't use the math operations in survey flow.
I guess I know how to do the calculation and how to store the embedded data, but how can I best retrieve the recode values of an answered question (Question IDs are known: QID7 // QID8)?
Some additional information: QID7 and QID8 are both Multiple Choice (single answer!) questions displayed on the same page.
Thanks!
Manfred
Get recode value of two questions
Best answer by StephH72
Hi Manfred,
I can only get it to work with a pagebreak between the two questions so hopefully someone can improve on this answer. But this is the code I have so far which works if the questions are on 2 pages:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
var Answer1 = "${q://QID7/SelectedChoicesRecode}";
var Answer2 = this.getChoiceAnswerValue();
var FinalAnswer = parseInt(Answer1) + parseInt(Answer2);
Qualtrics.SurveyEngine.setEmbeddedData( 'FinalAnswer ', FinalAnswer );
});
I hope this helps a bit :)
Steph
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.
