Use embedded metadata multi-valued text set for loop and merge | XM Community
Solved

Use embedded metadata multi-valued text set for loop and merge

  • 17 June 2020
  • 1 reply
  • 20 views

Badge +2

I have a survey where I would like students to answer a question for each subject they took. I can pipe the subjects they took into embedded metadata (I think this needs to be a comma-separated list in a single column. For example "Physics,English,Chemistry")
I then want do a loop and merge on this field. To do this, my understanding is I need to pipe this into a hidden question so that I can use that question for the loop and merge. I am trying to use the Javascript below to accomplish this but it does not seem to record anything.
Qualtrics.SurveyEngine.addOnReady(function()
{
  /*Place your JavaScript here to run when the page is fully displayed*/
  jQuery('input[id*='+this.questionId+']').val("${e://Field/Subject}")
  jQuery('#'+this.questionId).hide();
  this.clickNextButton();
});

Any suggestions?

icon

Best answer by TomG 18 June 2020, 01:14

View original

1 reply

Userlevel 7
Badge +27

Make your hidden question a multiple choice question where the choices are all the possible subjects. Then use display logic on each choice (subject):
Embedded Data 'Subject' Contains 'X'
where X is the choice subject. Based you loop off the displayed choices in the hidden MC question.
Then your JS just needs to hide and/or click the next button.

Leave a Reply