Hi All,
I am running into an issue with Setting Embedded Data via Javascript and then using it in branches & display logic.
In Q1, I am randomly assigning participants into control or intervention groups using the following code:
************
Qualtrics.SurveyEngine.addOnload(function()
{
var rnd = Math.random();
if (rnd >.5)
{
Qualtrics.SurveyEngine.setEmbeddedData("InterventionStatus","Intervention");
}
else
{
Qualtrics.SurveyEngine.setEmbeddedData("InterventionStatus","Control");
}
});
************
Based on the answer to the question of Q2, I am assigning a value to embedded data code:
************
Qualtrics.SurveyEngine.addOnUnload(function()
{
if (this.getChoiceRecodeValue(this.getSelectedChoices()) == 0) {
var age = 1;
}
else {
var age = 0;
}
Qualtrics.SurveyEngine.setEmbeddedData("U18",age);
});
************
The issue I am having is that after this question is done, I am branching to one of four different survey questions. Instead of branching, it is going directly to the end of the survey and skipping all branches. If I add a question on a new page AFTER the javascript questions and BEFORE the branching, it works. Any idea why this is happening?
Setting Embedded Data via Javascript
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.
