Hi!
I want to a create a variable based on responses to a set of statements in a matrix table. I am trying to do this by using the following. But this does not work. Anyone know of a different way? For example, using this.getChoiceRecodeValue(this.getSelectedChoices()); syntax? I don't know how to modify this for the matrix table.. thanks for any help!
Qualtrics.SurveyEngine.addOnPageSubmit(function() {
var paydec = "${q://QID94/SelectedAnswerRecode/3}";
if (paydec==="1"){
part2pay = 1.00;
}
else {
part2pay=0.40;
}
Qualtrics.SurveyEngine.setEmbeddedData("part2pay", part2pay);
recode value in Matrix question
Best answer by rondev
Use the below code:
This code checks if row choice 3 and answer col 2 is selected then if condition is true. Similarly you can change the row and column number and add logic accordingly.
Qualtrics.SurveyEngine.addOnPageSubmit(function(type)
{
if(type == "next")
{
var part2pay;
if(this.getChoiceValue(3,2)){
part2pay = 1.00;
}
else {
part2pay=0.40;
}
Qualtrics.SurveyEngine.setEmbeddedData("part2pay", part2pay);
}
});
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.
