Custom code to remove prime symbols/alternate apostrophes from comment responses? | XM Community
Skip to main content

We are seeing an issue in our exported survey data where some survey responses contain an alternate apostrophe/prime symbol ( ’ ) instead of a normal apostrophe ( ' ). We would like to know two things:

  1. Does anyone here know why some respondents' comment responses contain prime symbols, while other comment responses just contain normal apostrophes?

  2. Is there any custom code we can use (or any another solution within Qualtrics) to remove prime symbols or, ideally, replace prime symbols with normal apostrophes?

Thank you!

hi @echo,

you could use regex and replace on page submit

Qualtrics.SurveyEngine.addOnPageSubmit(function()
{

let et = document.getElementById('QR~'+this.questionId).value // get the text input

et = et.replace(/´/gm, "'")//regex for finding your character and replacing it by something

console.log(et)

document.getElementById('QR~'+this.questionId).value = et;//replaceing the old question text with the cleaned text

});
hope this helps

Best regards
Rudi


Leave a Reply