Using addEmbeddedData to create embedded data on the fly | XM Community
Skip to main content

Hi there,
I am using javascript in my survey to set many embedded fields. Here is the code:

//get question id
var qid = this.questionId;
//store the value in an embedded field
Qualtrics.SurveyEngine.addEmbeddedData( qid + "VideoName", currentVideo );
Qualtrics.SurveyEngine.setEmbeddedData( qid + "VideoName", currentVideo );

Where currentVideo is a string.

Unfortunately the embedded fields are not being created. I have so many it would be annoying to manually create an embedded field for every question. Is there a way to create an embedded field using only javascript?

TIA

addEmbeddedData works only on a page. Hence we cannot create embedded data using JS. We have to declare all the ED in the survey flow at the beginning and then only we can use setEmbeddedData function.
If you want to create many ED then upload a CSV file to a contact list, with all ED present in it. Then in the survey flow add ED element and click "add from contact" option.


Thank you rondev - great idea!


Leave a Reply