Forum Discussion

CraigWolfend195's avatar
CraigWolfend195
Community Member
3 years ago

Programmable: Variable List

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?

  • 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.

  • SteveGannon's avatar
    SteveGannon
    Community Member

    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.

  • Thank you for your feedback, I will look at this this afternoon.  Thank you for your help.