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

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!

@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


@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.


Thank you!


Leave a Reply