You are calling instance.data.randomizeList(); from Update but your function is called instance.data.shuffle
It’s cleaner to pass the list as a parameter through to instance.data.shuffle than retrieve it from the instance.data object.
If your inputList field is of Bubble ‘list’ type then you need to fetch it using .get() and .length(). Bubble doesn’t give you vanilla arrays directly from Properties can you have to call the .get() method to fetch them.
It’s fine to split the work across Initialize and Update functions and I often do this, but it does add complexity for debugging which for small things probably isn’t worth it, so your shuffle function could probably just sit within Update too.
Try the following:
Within INTIALIZE
instance.data.shuffle = function (a) {
var j, x, i;
for (i = a.length - 1; i > 0; i--) {
j = Math.floor(Math.random() * (i + 1));
x = a[i];
a[i] = a[j];
a[j] = x;
}
return a;
}