Home › Forums › Support › Get trial (Loop & Merge sample) number › Reply To: Get trial (Loop & Merge sample) number
April 23, 2015 at 3:43 pm
#2226
Keymaster
Hi Becky,
You’re close! But there’s a slight issue.
return '${lm://CurrentLoopNumber}' === 20
Evaluates, in Qualtrics, on CurrentLoopNumber 20 to:
return '20' === 20
Now, see for yourself. Open the developer console and then type in: ’20’ === 20. You’ll notice that it evaluates to “false”.
This is because === strictly type checks, next to value. ’20’ is a string, 20 is a number, these don’t match, so it’s false.
Fixing it simple. Simply wrap the 20 in quotes, so that it becomes a string: ’20’
return '${lm://CurrentLoopNumber}' === '20'
Hopefully you’ll be able to figure it out from here!
Best regards,
Erwin
-
This reply was modified 8 years, 7 months ago by
Erwin Haasnoot.