I have a question in a survey that uses the Essay Text Box type which allows users to enter multiple lines of text with line breaks. I need to run code to escape special characters, like line breaks, and then assign the escaped string to an embedded data field so that I can send that escaped text to another API via a POST request. These answer values must be escaped to be proper JSON in order to be properly received by the API.I try something like this in embedded javascript:Qualtrics.SurveyEngine.addOnReady(function(){ /*Place your JavaScript here to run when the page is fully displayed*/ var myvar = "${e://Field/notmodified}"; var anothervar = JSON.stringify(myvar); console.log(anothervar);});where the value of the embedded data field "notmodified" has been assigned in the survey flow using piped answer text:"one fishtwo fish"The result is invalid javascript, as it appears that when I try to assign the piped text to "myvar", what happens is this:var myvar = "one fishtwo fish";var an
I can't tell what the unexpected identifier is based on what qualtrics is giving me in the console. However, each time it happens, the error seems to come from the same line of code in one of the built in libraries. Here is the error info Qualtrics is giving me:vendor.4336af1e4e0f1264707f.js:1 Failed to evaluate page script in page SyntaxError: Unexpected identifier at eval () at https://jefferson.co1.qualtrics.com/jfe/static/dist/vendor.4336af1e4e0f1264707f.js:1:92606 at Function.globalEval (https://jefferson.co1.qualtrics.com/jfe/static/dist/vendor.4336af1e4e0f1264707f.js:1:92617) at N (https://jefferson.co1.qualtrics.com/jfe/static/dist/vendor.4336af1e4e0f1264707f.js:1:82472) at yt.fn.init.append (https://jefferson.co1.qualtrics.com/jfe/static/dist/vendor.4336af1e4e0f1264707f.js:1:137986) at https://jefferson.co1.qualtrics.com/jfe/static/dist/jfe.aae0f22679e5e5820520.js:1:106354 at r (https://jefferson.co1.qualtrics.com/jfe/static/dist/vendor.4336af1e4e0f1264707
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.