Reply To: Get trial (Loop & Merge sample) number

Home Forums Support Get trial (Loop & Merge sample) number Reply To: Get trial (Loop & Merge sample) number

#2226
Erwin Haasnoot
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