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
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.
You can read a Google Sheet and get a list from there and then randomly pick one of the words in that sheet. You will need Javascript for this. I can help offcourse.
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.
And here a version that gets data from a Google Sheet. Somewhat complexer.
Actually searching for a simpler solution. Found this...
https://www.npmjs.com/package/tabletop
Really simplifies the process.
Gonna make a sample with this too...
Thank you for your feedback, I will look at this this afternoon. Thank you for your help.