Custom code to remove double quotes after response collection? | XM Community
Skip to main content

We are seeing an issue in our API workflow where survey respondents using double quotes ( " ) in comment responses are causing the call to fail. The reason for the failure is due to the expected JSON key-value pair with the double-quotes. Qualtrics Support told us that we should be able to use custom code to remove the double quote after response collection. Does anyone here know what custom code we would use to remove double quotes from comments after response collection? Thanks in advance!

Qualtrics.SurveyEngine.addOnReady(function()
{
$('input').on('input', function() {
 var c = this.selectionStart,
   r = / ^a-z0-9]/gi,
   v = $(this).val();
 if(r.test(v)) {
  $(this).val(v.replace(r, ''));
  c--;
 }
 this.setSelectionRange(c, c);
});

});


Leave a Reply