Overwrite a question response at end of survey | XM Community
Skip to main content
Solved

Overwrite a question response at end of survey

  • February 9, 2022
  • 2 replies
  • 41 views

Aanurag_QC
QPN Level 5 ●●●●●
Forum|alt.badge.img+31

0
am trying to deselect the option selected in Q1 if someone selects an option in Q2.
For example if Q1 is an NPS question of a 0-10 scale and someone selects 5. In Q2, If someone selects "None" as one of the answer choices then I want the Q1 answer to be recorded as empty or null.
I am using the following code but is not working as expected:
if("${q://QID3/SelectedChoicesRecode}"=="1") jQuery("#"+this.questionId).empty();

Best answer by Aanurag_QC

The issue is that it is very difficult to unselect a single answer question (radio buttons). You could make your question a multi-select where all the choices are exclusive. That works for a regular multiple-choice question, but an NPS question doesn't have a multi-select option.


2 replies

jmborzick
QPN Level 5 ●●●●●
Forum|alt.badge.img+41
  • QPN Level 5 ●●●●●
  • February 11, 2022

Aanurag_QC A non-JavaScript solution would be to use Survey Flow and Embedded data. If you set an embedded data field and name it "Q1". The survey flow would set the field as the response from question 1. Then, you have branch logic after question 2 that resets Q1's value if "none" is selected.


Aanurag_QC
QPN Level 5 ●●●●●
Forum|alt.badge.img+31
  • Author
  • Answer
  • February 16, 2022

The issue is that it is very difficult to unselect a single answer question (radio buttons). You could make your question a multi-select where all the choices are exclusive. That works for a regular multiple-choice question, but an NPS question doesn't have a multi-select option.