Overwrite a question response at end of survey | XM Community
Solved

Overwrite a question response at end of survey

  • 9 February 2022
  • 2 replies
  • 13 views

Badge +30

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();

icon

Best answer by Aanurag_QC 16 February 2022, 13:08

View original

2 replies

Userlevel 6
Badge +33

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.

Badge +30

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.


Leave a Reply