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

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

  • October 6, 2022
  • 5 replies
  • 1304 views

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

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • October 7, 2022

Loop through the selected choices and use

getChoiceValue
.


Forum|alt.badge.img+1
  • Author
  • October 7, 2022

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?


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • October 7, 2022

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

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


TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • October 10, 2022

SuhasM
Qualtrics Employee
Forum|alt.badge.img+16
  • Qualtrics Employee
  • October 10, 2022

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