How to set embedded data using javascript? | XM Community
Skip to main content

Hi I have set up a questionnaire with 2 questions as follows:
image.pngQ1 contains some javascript:
Qualtrics.SurveyEngine.addOnload(function()
{
response.setContentType("text/plain");
Qualtrics.SurveyEngine.setEmbeddedData( 'caption1', "a" );
Qualtrics.SurveyEngine.setEmbeddedData( 'caption2', "b" );
Qualtrics.SurveyEngine.setEmbeddedData( 'caption3', "c" );
Qualtrics.SurveyEngine.setEmbeddedData( 'caption4', "d" );
});

that is supposed to allocate values to embedded data that then gets reused in Q2.
My flow is as follows:
image.pngHowever, this does not work and displays the following:
image.png
Can someone throw some light as to what I am doing wrong?

Delete this line response.setContentType("text/plain")


https://community.qualtrics.com/XMcommunity/discussion/comment/42640#Comment_42640Thanks AhmedA, that works a treat! Solved me untold headaches!


Leave a Reply