impossible to set a variable to (blank) using JavaScript from an external source?

I am having problems setting some variables outside of Storline 360 and reading them in so they can be identified.

Boolean variables and number variables work fine.

But it is text variables - principally when a text variable is set to be null or blank...

So logic that depends on a Storyline text variable being (blank) seems not to work...it works if the text contains a string but not when reading in a blank or null...

 

The issue we had with the “is (blank)” logic is when doing:

window.GetPlayer().SetVar('C1Q1', null);

window.GetPlayer().GetVar('C1Q1');

null

window.GetPlayer().SetVar('C1Q1', '');

window.GetPlayer().GetVar('C1Q1');

""

The is (blank) logic doesn’t seem to treat empty strings or nulls as blank, so we think it’s impossible to set a variable to (blank) using JavaScript, despite us verifying the variable was set correctly.

Help please very much appreciated...

Chris

7 Replies
Chris Pim

Hi Matthew,

I need a flag set from outside - a variable that either contains text or is blank when the data are read in and out. Then the logic will either select or deselect a checkbox. Checking if the variable is not blank works, but if the variable is required to be empty, blank, null or effectively contain nothing then Storyline does not understand the contents/lack of content. It's as if 'blank' is not the same in Storyline as an empty text variable. We have verified that the variable is being read in correctly but not being interpreted correctly.