Edit the way piped text from a question is shown in question text of follow up | XM Community
Question

Edit the way piped text from a question is shown in question text of follow up

  • 29 September 2020
  • 1 reply
  • 28 views

Dear Community,
I am looking for a solution to edit the way piped text is displayed in a question. I faced the issue before but always found a way to avoid it. Right now I am looking at the following:
We have four matrix questions with several items where respondents select on a scale / single select whether they like the items. If they like an item the selection would equal 1. In a follow up question we would like to show a list of all items they liked before. Below you see how I would do that with piped text (one of the questions is side-to-side with two columns).
${q://QID1%231/ChoiceGroup/SelectedChoicesForAnswer/1}
${q://QID1%232/ChoiceGroup/SelectedChoicesForAnswer/1}
${q://QID2/ChoiceGroup/SelectedChoicesForAnswer/1}
${q://QID3/ChoiceGroup/SelectedChoicesForAnswer/1}
${q://QID4/ChoiceGroup/SelectedChoicesForAnswer/1}
What we would like to get to is an actual list, meaning each selected item below each other potentially with bullets.
What we have right now is all items per question stringed together, separated by commas. If nothing is liked e.g. in Q2, than there is an empty row which looks weird. Also, when the same item is liked twice in the side-to-side they are displayed twice.
What I am seeking for: Any advice on what is feasible in terms of piped text editing? And how can it be done?

Thanks in advance!


1 reply

Userlevel 7
Badge +27

You could manipulate and display them with JavaScript. A general approach:

  1. Pipe them all into a single comma separated string either directly into the JS or in a hidden
    in the question text.

  2. Convert the string to an array

  3. Remove duplicates and blanks from the array

  4. Append each array item as an item (
  5. ) in an unordered list (
      )

    Leave a Reply