How do we execute a multi-punch question with a comma delimiter? | XM Community
Skip to main content
Solved

How do we execute a multi-punch question with a comma delimiter?

  • April 12, 2022
  • 2 replies
  • 133 views

Forum|alt.badge.img

We have a couple of surveys with multi-punch responses and we are seeking an answer to the following question:
How would we send data for multi-punch questions to Dynamics with a comma delimiter?
Sample (fake) question:
What are your favorite animals? Select as many as applicable:

  • Dogs

  • Cats

  • Snakes

  • Guinea pigs

  • Other (includes text box for recording response)

Best answer by Rudi

Hi @echo,
this is actually easier than you might think:
in the survey flow simple set embedded data fields with the respective selectedChoices (gives back the text as comma-separated string (mind the comma is followed by a blank) and/or selectedChoicesRecodes(gives back a comma-separated string with the recodes of the answers(mind here the comma is also followed by a blank)

image.png
Please mind that you might run into problems with the text option if:

  1. you have multiple languages because the labels in the selected survey language will be written into the embedded data fields

  2. if the answer items have a comma in the text.


if you need to change the format of string you might need to add some java script to manipulate the form of the comma-delimited embedded data
Hope this helps, best regards
Rudi

2 replies

Rudi
QPN Level 3 ●●●
Forum|alt.badge.img+16
  • QPN Level 3 ●●●
  • Answer
  • April 13, 2022

Hi @echo,
this is actually easier than you might think:
in the survey flow simple set embedded data fields with the respective selectedChoices (gives back the text as comma-separated string (mind the comma is followed by a blank) and/or selectedChoicesRecodes(gives back a comma-separated string with the recodes of the answers(mind here the comma is also followed by a blank)

image.png
Please mind that you might run into problems with the text option if:

  1. you have multiple languages because the labels in the selected survey language will be written into the embedded data fields

  2. if the answer items have a comma in the text.


if you need to change the format of string you might need to add some java script to manipulate the form of the comma-delimited embedded data
Hope this helps, best regards
Rudi


Forum|alt.badge.img
  • Author
  • June 2, 2022

Thank you!