I have a Storyline quiz and want to record the username (text variable 'userName') and result (number variable 'result') on a single row in my datasheet. I've used the following javascript with the result that the result score is shown in both fields but no username. Can you advise please?
var player = GetPlayer(); var entry = player.GetVar("userName"); var entry = player.GetVar("result"); CloudSet('username', entry); ClouSet('result', entry);
I confirm that I have a variable 'stencilusertoken'.
Can you advise please?
Reply
Posted on 3/6/2022
Please type your reply.
@support
One issue is a flawed javascript logic, but if lines 3 and 4 switch places then it should work. And another issue is that there's a letter "d" missing in "CloudSet" on the last line.
Reply
Posted on 3/6/2022
@samlincoln
Thank you John, I waited until I was able to amend and check. That simple change worked perfectly (the misspelling was purely a transcribe error not in the code I used). The the sequence change solved it. Thanks. Sam