Multiple choice value with comma - Salesforce multi-select picklist integration | XM Community

Multiple choice value with comma - Salesforce multi-select picklist integration

  • 1 December 2021
  • 9 replies
  • 470 views

Userlevel 1
Badge +4

We have a request to add a multiple answer multiple choice question to a survey such as:
Screenshot - 2021-12-01T083459.553.pngAnd using a workflow update a field in our Salesforce org that is defined as a multi-select picklist. The commas are giving us trouble, though. When a user selects the first choice the result in the Salesforce field is "A;B;or C", that is, three values. There does not seem to be an automatic method by which choices with commas are wrapped in quotes or some other technique of managing the existence of commas.
I am exploring javascript options at this time to run onPageSubmit and build an embedded field that is corrected for the existence of choices with commas but that seems like a bit overkill. Am I on the wrong track? Is there a better way to handle this situation?


9 replies

Userlevel 4
Badge +18

Chet An easier workaround I can think of is to have quotes in html of label and hide these quotes by styling. This way label would appear without  quotes in survey but in data we will have additional quotes.
This way it would look like:
"A, B,or C "

There is an option in data export using which we can split response of such question in different columns. I am not sure if this is available in salesforce Task but may be helpful if it is there.
Split multi values.png

Userlevel 1
Badge +4

Thanks for the suggestion KimothiSaurabh . The styling is certainly helpful for display purposes but it has no effect on the submitted response. The XML payload looks like this
"value": "\\"Hispanic, Latino, or Spanish Origin\\"",
which does not work. That is, the Multi-select picklist is populate but with values determined by splitting the field at comma delimiters. The Qualtrics implementation is simply not very robust when it comes to determining if commas are present and taking action to properly escape or wrap these values in quotes.

Userlevel 7
Badge +21

Yeah, this is a big problem. I've made a suggestion for simple text manipulation on the ideas page, might considering upvoting that.
If it's just one question, then just create three EDs (org_1, org_2, org_3) and set their values to individual elements of the answers. Then use these in the SF request. Ideally org_1 should always have a value, the others maybe empty based on the answer. Use branches to configure that.

Badge +7

If you post the link to your suggestion, I will upvote!

Userlevel 5
Badge +20

Hi Chet, might be a silly question, but does the value in your multiple choice - multiple answer question (i.e. A, B, or C) match exactly with the Salesforce multi-select picklist value API name?
For example, the Salesforce multi-select picklist value might be

A, B or C
but the underlying value API name might be
a_b_or_c
.
Cheers,
Cameron

Userlevel 1
Badge +4

CamM Indeed the picklist values and the API Name are identical in this case.
The problem is on the the Qualtrics side, though, as their "black box" is deciding how to identify, escape and\\or replace delimiters.

Userlevel 5
Badge +20

Chet Are you in a position to adjust your API name so that id doesn't leverage characters that are commonly used as delimiters? I know it's less than ideal making the change purely to suit Qualtrics, but you may find similar issues with other integrations down the track.

Userlevel 1
Badge +4

CamM I think you have misunderstood the problem. Qualtrics is creating the bad data. It has nothing to do with my Salesforce field definitions. I use other tools to integrate with Salesforce (e.g., Formstack forms) and map the exact same values to the exact same fields without issue. Qualtrics is parsing a choice that contains commas and replacing the commas with semi-colons.

Userlevel 5
Badge +20

Chet Sorry, you’re right. Just re-read the thread and realise what you’re getting at now. Thanks for the clarification and sorry for the confusion from my end 🙂

Leave a Reply