Recording User's Name and Email Address

May 07, 2012

I want to create a module for use in a tradeshow booth.   The module will be a game.  However, before the user starts to play I want to capture their name and email address and store it in a file such as Excel or any other file.

There is NO internet access available - everything has to be self-contained on a Windows laptop.

I can build a simple VBA/Macro in Excel which they would fill in and that would store the information. And then I could have a button to hyperlink to the course module.

But, my question is this:   Is there a way to build this completely in Storyline so that the user would enter their name and email into to text boxes and that variable would be added to a file such as Excel or Access?

The goal is to have a list of everyone who played the game in the booth.



63 Replies
Benjamin Caulder

I am not Java literate, but I can copy paste. Can anyone show me how to take the code Brian provided and do what Robin Leach here is suggesting?



Robin Leach said:

Hey Ben,

I am amazed at the script that you have setup so far.  I problably would have gone a different route due to lack of programming skills.  In Brian's video above he demonstrated an simple script that creates a text file.  You could modify the script slightly to put commas in between each item and have all data for each person on the same line.  The text file could then be renamed with a .csv extension and imported into Excel.  Just a thought.

Benjamin Caulder

Benjamin Caulder said:

The second bit of help I need is having this go to my server instead of C drive. I am not sure about file hierarchy so if someone has a moment, a detailed answer would be appreciated.



Maybe I should add the Javascript I have:

var fso = new ActiveXObject("Scripting.FileSystemObject");

var s = fso.OpenTextFile("", 8, true, 0);

var player = GetPlayer()

var name = player.GetVar("name");

var email = player.GetVar("email");

var school = player.GetVar("school");

var grade = player.GetVar("grade");

s.WriteLine("Name: " + name);

s.WriteLine("Email: " + email);

s.WriteLine("School: " + school);

s.WriteLine("Grade: " + grade);



Tim Neill

Ammanga Devi said:


By seeing the video i tried to implement them in Articulate story line. But i never get the warning of ActiveXControl. And the text files never is getting saved in my c: drive. i use windows 7. Could you solve my problem.

I have exactly the same problem - Windows 7, no warning message, no .txt file written. I also tried Windows XP and it's the same. Any ideas?

Russ Sawchuk

I couldn't get the script in the video to work either. Something must have changed since then. However, I was able to write that information to a text file using the example provided here.

The only problem was that you cannot send the Quiz Results variables - they are protected! If you try, nothing gets sent. However, I was able to send my own variables to a text file on the server just fine.

I am getting some help to figure out how to send the SL quiz results to a database table.


Anaelle Taddei

Here some answers for those who don't understand why the exemple of Ben doesn't work. 

I was in that case and for me i figure it out with two issue : 

First to allow this action with javascript you have to pass by Internet Explorer in order to have access to ActiveX, if you don't want to have Internet Explorere you can download an IE emulator on Chrome or Firefox. 

Second check if you have 2 trigger on the same button or hotspot, you have to put the trigger that execute javascript on top of all the button or hotspots actions, 

Now it works perfectly !

Good luck 

manish saraswat

Brian Batt said:

Hi Ben,

I put together a quick example for you here:

JavaScript is here:

(Note:  I am not a JavaScript expert and can't help you with any issues that you may run into.)

hi brain which you create really very nice but when i try to do this in pc its not working. I don't no why?

can you tell me what is exact problem.

thank u brain for this implement 

Ashley Terwilliger-Pollard

Hi Manish,

I'm not a Javascript expert either (far from it...) and Brian has taken another position within Articulate so he doesn't get into the forums as often. When testing this on your computer, are you testing the published output within the intended environment as described here? Testing it locally could cause you to run into some issues. 

Pedro Fernandez

hmmm.  I am starting to think that using the Javascript example provided in another forum to write to a simple text file may be a better option that dealing with ActiveX.

Save the grades to a text file using a comma or semi-colon as delimiters and then open in Excel to run a quick VB script to format everything.  No headaches with ActiveX or browser or computer security and no issues (for me anyway) with our IT Security team.

Ashley Terwilliger-Pollard

Hi Damien and welcome to Heroes!

Have you tested publish to Web? The other element to consider is you'll want to publish to your local drive as described here and then if you needed to place the published output on your USB drive (when you publish to a CD or other local source) you could do so after with the published output. You'll also want to test it within the intended environment as detailed here. 

Damien Rees

Thank you for the response Ashley!

I have tried what you said and explored other options, it still seems to not work. I dont understand what makes the difference from copying and pasting it to a different location, it acts as if the JavaScript doesn't even exist when transferred to usb or any other external location. Im testing ways to develop an offline lms and if somehow i could get this working it could open up many new possibilities on what i can do! 


AHme Joosub

Hi GUys

need to find out out two things, please if you can assit me out ...appreciate that

1) do I copy and paste the whole thing or need to change something

2) I have server that I need to put my storyline prjoect. I was wondering I can put excel file overthere as well. 

please let me know and then I will be ready to go

AHme Joosub

Hi Ashley

Thanks for replying :) actually I was talking about these lines of codes below in bold :) I have to replace it myself 

Also I am using Intranet and its hard to get a variables to pass through , there should be working way that come out recently specially for you have any info regarding

also is there storyline2 LMS got a database where variables can store and be use able and if it is please let me know how much it will cost. Thank

Please let me know, :) will wait for your response

var wsName = document.location.pathname;
wsName = wsName.replace(/\//gi, "\\\\"); // Replaces all forward slashes (/) with double back slashes (\\)
wsName = wsName.substring(2); // Removes the two leading slashes
wsName = wsName.replace(/%20/gi, " "); // Replaces %20 with spaces
wsName = wsName.substring(0, wsName.lastIndexOf("\\") + 1); // Removes the html file name from the file path

Ashley Terwilliger-Pollard

Hi AHme,

I'm not able to assist with Javascript code or elements - so I'll defer to the community on that. 

We don't support tracking or reporting information to a text database or similar, so you'd want to use an LMS to track and store information. In regards to an option available from Articulate, you may want to look at Articulate Online. 

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