Is it possible to set embedded data element from selected choice group? | XM Community
Skip to main content
Solved

Is it possible to set embedded data element from selected choice group?

  • July 1, 2019
  • 1 reply
  • 12 views

ambrubaker
Level 1 ●
Forum|alt.badge.img+2
I have a multiple choice question with answers organized into groups. Is it possible to capture the assigned group for a selected answer and set the value as an embedded data element?

Best answer by TomG

``` Qualtrics.SurveyEngine.addOnPageSubmit(function() { var group = jQuery("#"+this.questionId+" input:checked").closest("ul").prev().text(); Qualtrics.SurveyEngine.setEmbeddedData("group", group); }); ```

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • Answer
  • July 1, 2019
``` Qualtrics.SurveyEngine.addOnPageSubmit(function() { var group = jQuery("#"+this.questionId+" input:checked").closest("ul").prev().text(); Qualtrics.SurveyEngine.setEmbeddedData("group", group); }); ```