Generate a random array of entire numbers using a range

var arr = [];
while (arr.length < 6) {
  var r = Math.floor(Math.random() * 100) + 1;
  if (arr.indexOf(r) === -1) {
    arr.push(r);
  }
}
return arr.join(',');

One thing to note is that you can’t pass or return arrays to/from the JavaScript column. So it has to be returned as a string. But that can be coerced into an array by using a Split Text column if that’s what you actually need.

3 Likes