Hi all,
I have a question in which I store each change value of a slider in an Array and each time export this array in the same Embedded Data called "p_guesses_x" where x corresponds to the current Loop & Merge round.
What is very weird is that trying to complete the survey this "p_guesses_x" variables only contain one value, instead of being a list, even if more than one value was clicked on the slider.
I tried checking with console.log(list_left) and printing the Embedded Data inside the survey and it seems to work perfectly, the variable being printed with the form "VALUE, VALUE, VALUE,...". However, in the final DB, the list is not there anymore.
Please find an example of the code I am using below.
var list_left = [];
var round = "${lm://CurrentLoopNumber}";
document.getElementById("topleftSlider").onchange = function() {
getValuetopleft();
jQuery("#NextButton").show();
};
function getValuetopleft() {
var val = document.getElementById("topleftSlider").value //get the oninput value
list_left.push(val)
Qualtrics.SurveyEngine.setEmbeddedData('p_guesses_' + round, list_left)
}
What could be the cause of this weird behavior? Thanks a lot for your replies and help :)
Embedded Data containing Arrays not stored in final DB
Best answer by TomG
You can't store an JS array as an embedded data field. You have to stringify it somehow. Try this:
Qualtrics.SurveyEngine.setEmbeddedData('p_guesses_' + round, list_left.join(","));
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.
