Combine answers from multi-select question with '|' pipe symbol | XM Community
Skip to main content
Question

Combine answers from multi-select question with '|' pipe symbol

  • July 31, 2024
  • 2 replies
  • 64 views

bethk0710
Level 2 ●●
Forum|alt.badge.img+9

Hi,

I’ve found somewhat similar posts, but not one exactly for what we need. And assuming the only way to do what we are looking for is via JavaScript. And that is a little outside of my knowledge span.

We have a survey with a multi-select question and we need the answers to go back into a field in a specific manner. The selected choice piped text doesn’t quite work with commas.

Ques:

  • Answer 1
  • Answer 2
  • Answer 3
  • Answer 4

If the associate picks multiple items we need the result field to show like: ‘Answer 1|Answer 2|Answer 3’. Thought about making an embedded data field in the flow but if there is an answer they don’t select we do not want a blank space or || to happen. Hope that makes sense.

 

Thanks! 

2 replies

ArunDubey
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+41
  • QPN Level 8 ●●●●●●●●
  • 589 replies
  • July 31, 2024

That is why you will have to apply a branch logic for each option and need to check if option 1 is selected only that it will pipe in embedded field else it will skip. with the help of this branch logic check you handle || issue. If your answer options are not containing commas then you can handle via JS easily.


  • Level 4 ●●●●
  • 275 replies
  • August 7, 2024

i

Hi,

I’ve found somewhat similar posts, but not one exactly for what we need. And assuming the only way to do what we are looking for is via JavaScript. And that is a little outside of my knowledge span.

We have a survey with a multi-select question and we need the answers to go back into a field in a specific manner. The selected choice piped text doesn’t quite work with commas.

Ques:

  • Answer 1
  • Answer 2
  • Answer 3
  • Answer 4

If the associate picks multiple items we need the result field to show like: ‘Answer 1|Answer 2|Answer 3’. Thought about making an embedded data field in the flow but if there is an answer they don’t select we do not want a blank space or || to happen. Hope that makes sense.

 

Thanks! 

Hi,

 

There is a way to do this without JavaScript.  If you have a smaller number of options, you can use branch logic to set the embedded data like the way you need.