Correct JavaScript code to save number variable value to Data Cloud


What is the correct JavaScript code to save a Storyline number variable in the Data Cloud widget? All of my other triggers and fields are working, but they are all text variables. I have one variable that is the sum of three other variables, so it has to be a number variable.

I've tried many different variations and none of them are retrieving that variable, including:

var player = GetPlayer();
var entry = player.GetVar("MaskBehavior");
CloudSet('mask_behavior', entry);

Any advice would be much appreicated!

October 18, 2020, 7:49 pm

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

Lori, the code looks good. Can you post the link to the .story file? I'll take a look and see what's going on. You can remove all slides except for this one, I really don't need to see the entire project.

October 30, 2020, 12:49 pm

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

Hi John,
I would be happy to share the abbreviated .story file with you. Thanks for looking at it.


November 1, 2020, 9:16 pm

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

I forgot to add that I changed the variable to a text variable and instead am capturing four different ranges. Let me know if I should change that in the data cloud widget.


November 1, 2020, 9:17 pm

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


1 - Step 1 of the "How to use..." instructions is "Open Storyline and create a blank text variable stencilusertoken." I don't see this variable in your project.

2 - What exactly is not working?

November 2, 2020, 7:17 am

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