Some values not being pulled into sheets

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:

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!

May 24, 2021, 11:57 am

Click for thumbs down.0Click for thumbs up.0#1

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.

May 24, 2021, 2:19 pm

Click for thumbs down.0Click for thumbs up.0#2

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.

May 24, 2021, 3:08 pm

Click for thumbs down.0Click for thumbs up.0#3

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.

May 24, 2021, 3:14 pm

Click for thumbs down.0Click for thumbs up.1#4