Recording data from Multiple choice question answer text to embedded data | XM Community
Skip to main content
Solved

Recording data from Multiple choice question answer text to embedded data


Forum|alt.badge.img+1

I am new to Qualtrics so this likely has a simple solution however I am having trouble finding one that works. What I am looking to do is rather simple, present the user with their answer in a later text block. Specifically I am looking to save the option text for the answer the user selected into embedded data. 

Here is what I currently have, which gives me the code of the answer but I am looking for the option text:

Q284

    let selectedRecode = this.getChoiceRecodeValue(this.getSelectedChoices());
    Qualtrics.SurveyEngine.setEmbeddedData("ans", selectedRecode);

This is what I am trying but is not working:
Q285  

  let selectedanswer2 = this.getChoiceAnswerValue(this.getSelectedChoices());
    Qualtrics.SurveyEngine.setEmbeddedData("ans2", selectedanswer2);

Eventually I present the answer in test like this:

Q286

This was your answer:
${e://Field/ans2}

Please let me know if I am missing anything. Thank you!

Best answer by Nam Nguyen

@hchaudhary You don’t need to use embedded data, just chose piped-text → Question and you can show the selected choice of the previous answer

Hope this helps

View original

3 replies

Nam Nguyen
QPN Level 8 ●●●●●●●●
Forum|alt.badge.img+29
  • QPN Level 8 ●●●●●●●●
  • 1091 replies
  • Answer
  • October 5, 2023

@hchaudhary You don’t need to use embedded data, just chose piped-text → Question and you can show the selected choice of the previous answer

Hope this helps


rgupta15
Level 4 ●●●●
Forum|alt.badge.img+8
  • Level 4 ●●●●
  • 92 replies
  • October 5, 2023

@hchaudhary for the code I think just “this.getSelectedChoices()” should work and as you’re getting it’s recode you’re getting the recode. Remeber to use it onpageSubmit to function better, but as @dxconnamnguyen said, just use pipe-in and it should be good without any javaScript.


Forum|alt.badge.img+1
  • Author
  • 1 reply
  • October 5, 2023

Thank you!


Leave a Reply