How to get the value or recode value from getSelectedChoices () | XM Community

How to get the value or recode value from getSelectedChoices ()

  • 6 October 2022
  • 5 replies
  • 638 views

Userlevel 2
Badge +1

I am using the below javascript to get the selected answers but this is only giving me the choice number and I want the value. How can get the value of the selected answer and not just the number?
var choices = this.getSelectedChoices ();
console.log('choices are: ' + choices);


5 replies

Userlevel 7
Badge +27

Loop through the selected choices and use

getChoiceValue
.

Userlevel 2
Badge +1

Thank you very much TomG. Could you please advise me how to get a text input from a multiple choice question that allows text input?

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/50516#Comment_50516I think you can use

getTextValue
. Alternatively, you can get it from the DOM.

Userlevel 7
Badge +27

https://community.qualtrics.com/XMcommunity/discussion/comment/50516#Comment_50516As I mentioned above, use

this.getTextValue(choiceid)
.

Userlevel 4
Badge +16

Great watching you guys Simin TomG collaborate to reach a custom code solution! 🙂

Leave a Reply