Embedded data is incomplete when download/reported | XM Community
Question

Embedded data is incomplete when download/reported


When there is embedded data that looks like
[{x:1,y:2},{x:3,y:4}]
it is reported/downloaded as
[{"x":1,"y":2}]
Is there any way around this (aside storing the embedded data in a different format).
Or, since I imagine this is from some processing of the embedded data or the conversion to strings, is there any way to turn the processing/conversion off?
Here is a simply way to reproduce this behavior:

  1. Create two text/graphics questions (and an embedded data field named "test")

  2. in the first question, put the following javascript code:

Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
let var1 = {x:1,y:2};
let var2 = {x:3,y:4};
let embed = [var1, var2];
Qualtrics.SurveyEngine.setEmbeddedData("test",embed);
});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/
});
  1. In the second question put the following html and javascript

Value:



Qualtrics.SurveyEngine.addOnload(function()
{
/*Place your JavaScript here to run when the page loads*/
let embed=Qualtrics.SurveyEngine.getEmbeddedData("test");

var output = document.getElementById("demo");

output.innerHTML ="first x is " + embed[0].x + " first y is " + embed[0].y + " second x is " + embed[1].x + "second y is" + embed[1].y

});

Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/

});

Qualtrics.SurveyEngine.addOnUnload(function()
{
/*Place your JavaScript here to run when the page is unloaded*/

});

Then preview the survey (not the question), go to the end, and view the embedded data.


0 replies

Be the first to reply!

Leave a Reply