Importing and retaining variables

Jun 06, 2012

Is there a way to import variables from external files.  I want to design a review game that instructors can input thier questions into a Storyline presentation from a text file. I want to setup a template game that can be used for any question review.

I'm not sure if this is related to the above question but I would also be interested in being able to save variables so when the Storyline is re-opened it retains variables from the last time it was open. 

29 Replies
Phil Mayor


The easy one first if you use an LMS or flash cookie, and enable this in the publish settings, the variables will be saved, in the case of flash cookie it is machine specific.

You can read in variable from a text fileusing a javascript trigger, this should get you started

Mark Baranowski

I got this script off this blog:

Save Storyline variables to a text file

var fso = new ActiveXObject("Scripting.FileSystemObject");
var s = fso.OpenTextFile("C:\\Test.txt", 8, true, 0);
var name = player.GetVar("TextEntry");
var email = player.GetVar("TextEntry1");
s.WriteLine("Email: " + email);
s.WriteLine("Name: " + name);

Mark Baranowski

HI Miriam,

Sorry for the delay in posting - was really busy today.

Luckily - the client went a different way with their project and I never had to import from a v ariable in a txtt file via javascript. 

I have seen some examples on this blog of using Flash within Storyline and importing data from XML - but Flash won't work on iPad.


David McGhee

Thanks again Bruce. I'm amazed that Articulate hasn't provided a complete
solution for this. I supposes others have cobbled together their own
solution, as I see many many requests.

Sorry, I don't mean to impose on you to solve mine, and others problems in
this regard. I simply don't have the knowledge to accomodate your learned
advice. :(
- David

Ashley Terwilliger-Pollard

Hi David,

I just wanted to chime in that it isn't something we support, that's why there is not an "official solution" but a lot of users have had success with the ones shared here. You'll also want to confirm that you're testing this final published output within the intended environment as testing it locally could cause you to encounter security restrictions that may cause this not to work. 

Ashley Terwilliger-Pollard

Hi David,

I'm sure there have been feature requests connected to this topic, and those go directly to our product development team for review - and as I mentioned, this is outside my expertise so I wouldn't weigh in on the possibility or feasibility of it. The more feature requests, generally the better though. 

David McGhee

Ok, you are sure there has been feature requests connect to this topic, and you suggest through these request the "team can think through the set up and implications."

Can you offer any insite about the team's progress in this regard or if it's even being discussued or in the pipeline? After years of requests on the matter I'd think think Articulate could offer more than a prod to put in a feature request.

As a user, its frustrating to enter these chats where Articulate STaff's common response is "put in a feature request" please.

Ashley Terwilliger-Pollard

Hi David, 

I know I've seen other people mention it in the forums and indicating that they were going to submit requests - whether or not they actually did is something I don't have additional information on.

In regards to the process our team goes through, you can read through this synopsis of the process here. Please know that this article is a bit older, but the same process still applies. We don't share a roadmap or information in regards to what new features will or will not be included. 

I can certainly understand the frustration and apologize that I don't have more information to share with you, but sometimes it's not even information I am privy too! 

Chris R

I searched just now on this topic and was hoping SL2 had a feature where by you could define a set of variables (either manually within the application) or via file import, as well as the capability to import updated values. From there, one would define those variables embedded within text anywhere I need them (ie text to read on a slide/layer, state or within a quizzing Q). None of this is possible?

I've built a course for new hires with lots of facts and figures about staffing, how much the division represents of the total organization, how one location compares to another etc. All these values are static text, resident within text boxes. I have an offline Excel file I update and it provides #s and %s I need.

I have an indexed sheet in the workbook which identifies the location within my .story file i need to edit but I'm just editing static text. I was hoping I could define these 'variable data tokens" and reference them anyway for display or calculation purposes within the course. Import new values on whatever frequency I need, republish and Bam, Done.

Not happening? :(

Jay Dharap

Hi Phil!

This is just what i was looking for...only that i want to use the first name only.

I published ran this on my LMS (Cornerstone) and got the page (attached). 

I am clueless about JS so any idea why I see that undefined bit before my name?

Because wanted to use just the first name so I tried editing the line to var newName = array[1];

but that did not work, all I got on that slide was a NULL.

Any idea how I can get that JS to show just the first name?