Programmable: Variable List

Jun 14, 2022

Please can someone help.  

I would like to create a programmable list when Articulate program starts.  Once the program has loaded I would pick a random item from the list for use in my project.

For example.... Say I wanted to create a spelling program.  Rather than having the same word every time, I would like the system to pick one randomly from a list every time the program is loaded.

Is this possible?  Would I need to utilise JavaScript?  If so, are there any scripters that can help?

5 Replies
Craig Wolfenden

Is it possible to have a dictionary of words in a file, like a Excel or Word doc, then have Articulate pull a word at random from the dictionary and place it into the program as a variable.  This would save hard coding every word into the document which contain a lot of triggers per word.

Steve Gannon

Craig, 

As Math indicated, you can use Google Sheets. There are lots of great discussions in the forum on how to do this.

If the list of words will not need to be frequently edited by someone without Storyline, you can hard-code the terms in a JavaScript array. Attached is a very simple example with 20 words. Just publish this file for Web (you can't preview it, you have to publish it) and just keep refreshing your browser to see one of the random words appear. Open the JavaScript in the Execute JavaScript trigger to see how it is set up.