Updating default choices | Experience Community
Skip to main content
Solved

Updating default choices

  • Jan 31, 2020 6:14 PM UTC
  • 4 replies
  • 114 views

Forum|alt.badge.img+6
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

Best answer by StephenR

For the record, somebody helped me find a solution to this using localStorage in Javascript.
View original

4 replies

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Feb 2, 2020 5:31 PM UTC
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.

Forum|alt.badge.img+6
  • Author
  • Level 1 ●
  • Feb 3, 2020 9:20 AM UTC
@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.)

Forum|alt.badge.img+6
  • Author
  • Level 1 ●
  • Answer
  • Feb 3, 2020 5:00 PM UTC
For the record, somebody helped me find a solution to this using localStorage in Javascript.

  • Jul 1, 2021 8:32 AM UTC

Can you share the solution?