user
@skripteekof
Some values not being pulled into sheets
Hi,
I have a big issue. Some values are not being pulled into Google Sheets (around 60% of them are, 40% not). As this is happens randomly (or so it seems), I cannot locate what the issue is.

In my storyline file, I have set this code to be executed when quiz results slide is started:
var player = GetPlayer();
var email = player.GetVar("Emailadresa");
SheetsSet('Email adresa', email);
var brojpoena = player.GetVar("Brojpoena");
SheetsSet('Score', brojpoena);

This is the google sheets spreadsheet I transfer the data to:
https://ibb.co/7bdGjKq

An interesting note is that first variable (email) is always transferred, but the second one (brojpoena) isn't (but it seems the code is not wrong, because sometimes it works just fine).

Any help would be greatly appreciated, as I would like to significantly scale up the use of this widget. Thank you!
reply
Reply
user
@support
Hello. You're correct, your code is not wrong, it's gotta be something about the way your storyline project is structured. Check the logic of the triggers, make sure that the user does not navigate away to another slide before the trigger executes, make sure that if a new layer opens, it doesn't pause the execution on the base layer - things like that. But the code is fine.
reply
Reply
user
@skripteekof
Thank you John! The problem might have been a few seconds needed for the server to send the data, whereas a user exited before it completed. I changed the project so that it has a message of "Please wait for a few seconds..." before the stencilrendered variable changes (with the condition of it being equal to 1 to make it react only to second change of the variable, to 2), with the goal of prompting the user to wait before the server sends the data, and in the latest sample testing of 20 users it works as expected, no more issue. I really hope that was the problem because my head hurts of trying to figure out what it is! :) Posting this here in case anyone experiences a similar issue, and will surely update the thread if the problem appears again.
reply
Reply
user
@support
Ahh yes, that makes sense. Google Sheets API is very slow, it takes a few seconds for the call to go through. If this becomes an issue, you can switch to Data Cloud, which usually takes less than 1 second per call.
reply
Reply