Piping in a varying list of items | XM Community
Skip to main content

In short: I want to assess a varying number (10-200) of student names for each survey, then assess each in multiple dimensions.

I am bringing in the list of student names as embedded data (sequentially numbered fields) - and typically many are blank. Then I assess each using piped text into the assessment question. However, there are a lot of blank fields when the list is less than 200.

In a separate post:

 there was a similar problem addressed, but I’m not clear on how to perform the checkbox step (step 4).

I don't want to use loop/merge (seems unnecessary), so probably that’s impacting what the Javascript should be to select each embedded student name.

So, I’m 1) bringing in the embedded data into a hidden question (the JS works for that). 
Then in that question, 2) I want to select the names that are not blank.  The aforementioned JS doesn’t work - and where does it even go?  (Not working: <code>if (!Qualtrics.SurveyEngine.getEmbeddedData('v'+i)==""){this.setChoiceValue(i,true);}</code>)

Then 3) I can easily carry forward the selected items (not blank) to the displayed assessment question

 

Update - 

Given the separate post uses Loop and Merge, and I don’t want to do that, I think I can test, then assign the value for each embedded value in the hidden question.

What would the JS be for that?

I tried using this for each statement, but it doesn’t work

’if (!Qualtrics.SurveyEngine.choiceID(1)==""){this.setChoiceValue(1,false);} 

Given that each statement is a separate embedded value name, How do I test each statement and assign the Choice value to false if it’s blank?


SOLVED -  as with so many things in Qualtrics there are many ways of solving the problem. No JavaScript required.

  1. I added an embedded value for the number of names for each survey (this is easily calculated from the other embedded data)
  2. Use display logic for each name in the assessment so that name is only displayed if the number of names is at least that response number.

 


Leave a Reply