Please try this code out:
[% Begin Unverified Perl
my $listName = 'list2';
my $item = 1;
my $jsArr = LISTVALUESARRAY($listName);
$jsArr =~ s/^.//;
$jsArr =~ s/.$//;
my @arr = split /,/, $jsArr;
my $index = 0;
foreach my $val (@arr) {
$index++;
if ($val == $item) {
last;
}
}
return $index;
End Unverified %]
Lines 2 and 3 should be updated with the name of the randomized list and the item whose randomized position you want returned.