Assign a glide list content to an array variable

Hi,

Does anybody know how to assign the content of a glide list to an array variable ? The reason why I am asking is because I struggled to achieve this considering that a glide list is essentially an array although they are different types (glide list type, array type).

In the end the only way I could get this to work was to strip down the glide list and recreate an array via push to result. Is this the only way or is there a more cleverer / simpler way to achieve the same thing ?

cheers

John


ah so that is the easier way, OK will check it out

cheers


This may be exactly what you're doing, but I just use the regular JavaScript 'split' method to create an array.
The value of a glide_list variable is actually just a comma-separated string so you can use 'split' to parse out the values in that string into an array of substrings like this...

//Create an array from the contents of the 'watch_list' field
var watchListArray = current.watch_list.split(",")

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.