Write value from variable into dataset in responses | XM Community
Skip to main content

Hi all
I have a variable that is randomized across respondents, e.g. using this code:
Qualtrics.SurveyEngine.addOnload(function(){
   function randomizep1() {
      player1_draw = 1'A', 'B'];
var rand_p1 = player1_drawy(Math.random() * player1_draw.length) | 0];
      return rand_p1;
   };
   var rand_p1= randomizep1();
   Qualtrics.SurveyEngine.setEmbeddedData("rand_p1", rand_p1);   
   var rand_p1=        "${e://Field/rand_p1}";
});
How do I ensure that the value of "rand_p1" (i.e. "A" or "B", depending on the respondent) is available in my data set after I fielded the survey?
Many thanks in advance.

Be the first to reply!

Leave a Reply