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

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

  • Oct 6, 2022 5:06 PM UTC
  • 5 replies
  • 1406 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 ●●●●●●●●
  • Oct 7, 2022 12:48 PM UTC

Loop through the selected choices and use

getChoiceValue
.


Forum|alt.badge.img+1
  • Author
  • Oct 7, 2022 1:32 PM UTC

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 ●●●●●●●●
  • Oct 7, 2022 2:38 PM UTC

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 ●●●●●●●●
  • Oct 10, 2022 2:23 PM UTC

SuhasM
Qualtrics Employee
Forum|alt.badge.img+16
  • Qualtrics Employee
  • Oct 10, 2022 3:51 PM UTC

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