Not Recording Embedded Data In Response Using JavaScript | Experience Community
Skip to main content
Solved

Not Recording Embedded Data In Response Using JavaScript


Forum|alt.badge.img+1

I use JavaScript to create 3 columns, a drop down list (Option), a text field (Name) and a text field (Score) with 10 rows showing first (can be added to 20 rows). The JavaScript is put on a text/graphic field and I have also added “<div id="dynamicEntryTable"></div> “ to the html in the text/graphic field. 

Then I added embedded data - “row_01_option”, “row_01_name” and “row_01_score” for up to 20 rows for the 3 columns. However, I couldn’t record the embedded data in the responses. The JavaScript link and the embedded data (as image) are below. Can someone  help me to identify what’s wrong and how I can record the embedded data in the responses?  Many thanks.

JavaScript Link:
https://docs.google.com/document/d/17y9R7vC5dzm3H32CTmKs7gI6U-Vwu0IVctdf0iGxJoE/edit?usp=sharing

Thanks,
Simon
 

Best answer by Romanoman

...

.... Maybe I should change the embedded data to __js_row_01_option, __js_row_01_name, __js_row_01_score to 20 rows?

oh yes, if you want them to be stored, good point - all of them need to be defined with their true (javascript) names as the survey sees them.

View original

3 replies

Romanoman
Level 5 ●●●●●
Forum|alt.badge.img+15
  • Level 5 ●●●●●
  • October 19, 2026

Have you tried doing this later?

I assume you have the Embedded Data fields defined before you use them, but as far as I know, this only sets test_save to the value of __js_test_save at that moment. So if you want the value that __js_test_save gets later, this assignment needs to happen later as well.


Forum|alt.badge.img+1
  • Author
  • October 19, 2026

Have you tried doing this later?

I assume you have the Embedded Data fields defined before you use them, but as far as I know, this only sets test_save to the value of __js_test_save at that moment. So if you want the value that __js_test_save gets later, this assignment needs to happen later as well.

Hi Roman,

Many thanks for the reply. I have put the embedded block above of my question block as it didn’t work when I put below the question block. However, the test_save is there mainly for testing. The actual data I need is the  “row_01_option”, “row_01_name”, “row_01_score” to 20 rows embedded data recorded. Maybe I should change the embedded data to __js_row_01_option, __js_row_01_name, __js_row_01_score to 20 rows?


Romanoman
Level 5 ●●●●●
Forum|alt.badge.img+15
  • Level 5 ●●●●●
  • Answer
  • October 19, 2026

...

.... Maybe I should change the embedded data to __js_row_01_option, __js_row_01_name, __js_row_01_score to 20 rows?

oh yes, if you want them to be stored, good point - all of them need to be defined with their true (javascript) names as the survey sees them.