I am piping answers to a subsequent question, but when two of the options are selected and displayed using piped text it uses a comma rather than 'and' (see pic below).
How can I replace the comma with 'and', but only when two answers were selected (e.g., i don't want 'and' displayed when only one answer was selected). Does anyone have a solution to this please - i'm new to Qualtrics so might have missed an obvious solution.
Solved
How do I change the comma to 'and' in piped text?
Best answer by ahmedA
In the question HTML pipe the answers into a span. Something like this:
${...} Then use JS to convert the commas to and.
Qualtrics.SurveyEngine.addOnReady(function () {
let new_text = this.questionContainer
.querySelector("#my_answers")
.innerText.replaceAll(",", " and");
this.questionContainer.querySelector("#my_answers").innerText = new_text;
});
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
