Error message in javascript | XM Community
Skip to main content
I am trying to implement http://mgto.org/quick-qualtrics-tricks-3-scale-results-calculation/ for the SF-36 (a standard physical and mental health questionnaire).



I get an error when I add the javascript setting a variable to an answer from a survey question. This leads to an error message on saving of the javascript of "Invalid JavaScript! You cannot save until you fix all errors: Unexpected token {



Qualtrics.SurveyEngine.addOnload(function()

{

var pf1 = ${q://QID13/ChoiceDescription/1};

});



Could anybody advise?
Hello @Christoph ,



Put the piped text in double quotes as shown below:



`var pf1 = "${q://QID13/ChoiceDescription/1}";`
Thank you! A small thing but really helpful.

Leave a Reply