How to capture the index for answer to drill down question | XM Community
Skip to main content

I have a drill down question where the first level asks the participant to select a county. I would like to save the index value for the county that the participant selects into an embedded data field called “CountyPick.” 

Right now I have this code:

     var CountySelection = " ${q://QID23/ChoiceGroup/SelectedAnswers/1}"
     Qualtrics.SurveyEngine.setEmbeddedData('CountyPick', CountySelection);    

 

This is saving the name of the county, instead of the index value for the county. Does anyone know how I can capture the index?

 

 

 

 

In case anyone else is looking for something like this, I ended up using:
 

   var CountySelection = jQuery("#"+this.questionId+" select").eq(0).val();
Qualtrics.SurveyEngine.setEmbeddedData('CountyPick', CountySelection);

 

 

 


Leave a Reply