Importing and retaining variables
Jun 06, 2012
By
Robin Leach
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
Robin
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 http://www.articulate.com/support/kb_article.php?product=st1&id=llwes8cn32vg
Does anyone have a direct answer to this?
"Is there a way to import variables from external files?"
I would like to see a javascript example please.
Yes you can import from external data sources, the only one I have to hand is this one, this reads from the LMS and brings in the users name
Thanks Phil - nice try - not quite what I was looking for.
I was thinking locally - like loading or saving to a text file.
I've found some script for saving to a text file.
It's the loading part I'm not sure of.
M,
Would you be willing to share that script you found for writing to a text file?
I got this script off this blog: http://www.articulate.com/support/kb_article.php?product=st1&id=llwes8cn32vg
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);
s.WriteLine("==========");
s.Close();
Mark, were you ever able to figure out how to import variables from an external source? Our company uses SiteMinder to autenticate users. I want to be able to get the user name from SiteMinder (our IT guys assure me they can write the variable, but need some way to pass it to Storyline).
Hi Miriam! I'm not sure if Mark is subscribed to this thread, so you may need to shoot him a PM.
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.
Bye!
Thanks Mark for chiming back in!
Has anyone figured out how to get text from a text file or excel into storyline?
Thanks,
Hi,
Being able to pass data into SL has been something I wanted to solve and now it's a bit closer. I came across this solution. Haven't tested it out yet but it looks like what you need.
Its the code snippets that you need - the demo is not what you might expect.
Follow this link
Thanks. The solution looks simple, but alas incomplete. I'm a novice. I'll
like trying to figure this out, but won't likely be able to make the time.
I'm goiing to try though. May need some hand holding.
I think the basics are there as a prototype. Ideally you would want a csv file .
I can see how it could be used though;
a. Fill in a web form so you populate the variables.
b. Pass those variables to the sl html page.
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
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.
Hi Ashley,
I had a thought as I was driving home last night, SL allows the export and import of text for translation. So there is a mechanism to parse that information, surely it would not be a huge step further to support variable import for the community of users that have asked for it...?
Hi Bruce,
I'm not a coder or programmer, so how easy it might be is beyond me - but you may want to share that idea in the feature request so that our team can think through the set up and implications of that.
So you're telling us after 5 years or more of us discussing this topic there are no "feature requests"?
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.
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.
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!
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? :(
Prepare to be invited to file a formal request, Chris, bcs thats been the
Artiulate party line on the matter for the past 5 plus years. And still
even today Articulate can't tell you if its even in their development
channel.
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?