filter on answer (higher than/lower than) on same page | XM Community
Skip to main content

I am looking to create a function that will filter answers from a question on same page.
in qid B1B the chosen code, and all codes with a lower numeric value from B1A, must be removed, while higher codes must be displayed.
i have this bit of code (that works in a script in confirmit) - how do i make it perform the same way in Qualtrics?
//My scripting:
function B1Bk() //the function called to filter answerlist B1B
 {
 var s = new Set()
 var max = 31;
 
if ( f('B1A')==max ) //If the highest value is selected
 {
  s = max; //we want to ensure that a logical answer is shown, so max is always shown
 }

 else if (f('B1A').toBoolean()) //if B1a is not=max, but still has been given an answer
 {
 var a = f('B1A').toInt() ;  
     a=a+1
      s=nnset(a,max); //limit answers displayed to the codes higher than the chosen one, up to max value
 }
 return s
}
I am complete new to qualtrics, but has worked with the way confirmit uses javascript/j-script for some years now.

Be the first to reply!

Leave a Reply