The World's Simplest JS Embedded Data Problem | XM Community
Skip to main content
Question

The World's Simplest JS Embedded Data Problem

  • February 27, 2025
  • 1 reply
  • 26 views

Forum|alt.badge.img

Hi! I’ve been going insane trying to figure out what’s going wrong here. The goal of this is to use Javascript in order to generate embedded data that gets used later in the survey. However, it doesn’t seem to be working. I can’t figure out what else is failing here, and I assume I’m messing up somewhere with setJSEmbeddedData.

the `control` embedded data value works fine - but where’s the `test` embedded data we set?

 

Thank you so much if you try to help. I’m certain it’s something simple that I’m missing. I’ve coded in Javascript before!

1 reply

vgayraud
QPN Level 5 ●●●●●
Forum|alt.badge.img+48
  • QPN Level 5 ●●●●●
  • 361 replies
  • February 27, 2025

The piped-in text on your question page ${e://Field/__js_test} is loaded before your script is executed.

The script would have to be placed in a question before the one where you display the result.

If you check the value for __js_test in the Data & Analysis tab, it should be filled.


Leave a Reply