Array Variable Type?

Nov 11, 2020

Has there been any serious consideration given to adding "Array" as a variable-type to the existing Boolean, Text, and Numeric variables?

While I am able to both store and retrieve an array from an LMS using Javascript, I have to convert the single array into individual elements and populate individual variables in Storyline with those elements. Then, on the flip side, I need to retrieve the individual variables from Storyline and populate the elements in the array with those variables' values, using Javascript.

Within a Storyline course, a single array could be used to replace a battery of Boolean variables which are used to, for example, track the "viewed" status of individual slides.

JavaScript Arrays
https://www.w3schools.com/js/js_arrays.asp

4 Replies
Math Notermans

As said, you can use either variables or Storyline textfields as containers for Arrays. Offcourse still Javascript needed to use it, but as you can see in this sample using Arrays and Javascript really opens up a lot of possibilities in Storyline...

https://360.articulate.com/review/content/2641479d-6c12-47a8-b741-f24d537a39de/review

textArrays

In this sample i mainly show how you can get ALL elements from an Storyline slide into any given array and manipulate them with javascript. As Storyline renders all elements as SVG especially for text there are some specific things to keep in mind. Showing how to cope with that here too.

Joseph Francis

You solution still requires "stepping out" of the Storyline variable environment into the Javascript environment (and doing some serious scripting in the process) to make it all work.

An array within Storyline (it can be single-dimensional to begin with) is what I am looking for, without needing to rely on Javascript to do the heavy lifting.

Math Notermans

Would be nice, but what Array functionality you would like then? Because an array in any code has quite some functionality.

Just to name a few basic ones...push, order, sort, remove, pop, shift, unshift, slice... and on and on. Personally, yes, it would be great to have that kind of functionality available in Storyline, but as is i dont think that is gonna happen and you better rely on Javascript for that.