Pull an external variable into Storyline

Jan 19, 2018

Hello, I'm trying to figure out if this is possible. I have a variable that exists within an external HTML page and I want to grab the value of that variable and display it within Storyline. Is this possible?

 

Thanks

Steve

1 Reply
OWEN HOLT

It might be IF you are using HTML5 and IF both pages are the same origin (per domain and protocol). All pages, from one origin, can store and access the same data using HTML5 Web Storage.

On your HTML page, send the data to storage: 
// Store
localStorage.lastname = "Smith";

In StoryLine:
// Retrieve
var player = player.GetPlayer():
var retrieveValue = localStorage.lastname;
player.SetVar("StoryLine Variable", retrieveValue);

As I said, this should work in theory, however, I haven't tested it other than through the browser developers tools window using 2 different SL files opened locally and on 2 different tabs.

This discussion is closed. You can start a new discussion or contact Articulate Support.