Updating default choices | XM Community
Solved

Updating default choices

  • 31 January 2020
  • 4 replies
  • 42 views

Userlevel 1
Badge +2
This seems a basic request but I can't figure it out. I have some questions (matrix table if it matters) with default choices, pulled from my contact list. This works.

I want my respondents to be able to change these answers. But I want the answers to be pulled through to later questions. I have done this using default choices (piping from survey questions), and this works initially, but if I go back and change the answers to the first question, the new values are not pulled through to the later questions. A support person tells me that this is intended functionality.

Does anyone have any pointers to how I might get around this. JS?

TIA.

Stephen
icon

Best answer by StephenR 3 February 2020, 18:00

View original

4 replies

Userlevel 7
Badge +27
Post the JavaScript that is setting the default choices.

What is probably happening is that when the respondent goes back the JS is re-populating the default choices. The solution it to check if the question has already been answered before populating the default choices.
Userlevel 1
Badge +2
@TomG - thanks for looking. I may not have explained well. I have not used JS to set the choices.

So the first question has `${e://Field/Q8_IND_C6ii_A_q1}`

(which is pulled from a contact list via an embedded data field). Some of these questions will have been answered previously (as it is a repeat survey) so I'm not sure if a check as you suggest would work.

The answer above is pulled through to later questions using

`${q://QID30/ChoiceTextEntryValue/1/1}`

(I do have some JS but that is just working out some ratios and making boxes read only and as far as I can see does not affect this issue.)
Userlevel 1
Badge +2
For the record, somebody helped me find a solution to this using localStorage in Javascript.

Can you share the solution?

Leave a Reply