How ensure consistent comma appearing in between the piped text from Matrix table? | XM Community
Skip to main content

Hi all,
I have a matrix table asking the satisfaction level (7 scale rating) for different products. If they rated 5 or lower rating then they would be routed to ask an open-ended question. And I want to pipe in the products that have been given poor rating. However there's inconsistent commas, or spacing depending on how many products selected from the prior question.
I have tried using the JS for comma replacement, or embedded data on the Qualtrics community but does not seem to work. I am thinking is it because I am only showing selected choices for rating of 5 or lower (and not all selected choices should be displayed), hence I might need to tweak some codes but have run out of idea to fix it.

qualtrics.PNG

Show us what you are piping (i.e., what does the question text look like in the Qualtrics editor).


question.PNGThis is what I am trying to pipe in


Can you show us the Question text for your text entry question (where you pipe the matrix products)?


question2.PNGHere you go. Thanks! I thought I had shared in the question, but apparently I did not


Replace the answer pipes with


Then in JS:
var arr = ["${q://QID3/ChoiceGroup/SelectedChoiceForAnswer/5}", ... ]; //... is the rest of the pipes
jQuery("#pipe").html(arr.join(", "));


js.PNGI am new to this, so I assume this where I should put my JS code. Where can I change my answer pipes with 




Yes, either addOnReady or addOnload will work. Add

to your question text in html view where you want the pipes displayed.


Thanks Tom! You have been very helpful! This is close to what we have & finally figured out something close to this, and loop each index to remove the commas for undefined/blank choices that are not low ratings.


Leave a Reply