Hello, the code below works in that it does randomize the items but it loads ALL items into the repeater. I’d like to only load ONE random item. Can someone help me find what I need to change?
import  {  local  }  from  ‘wix-storage’ ;
import  wixLocation  from  ‘wix-location’ ;
import  wixWindow  from  ‘wix-window’ ;
import  wixData  from  ‘wix-data’ ;
import  wixUsers  from  ‘wix-users’ ;
let  user  =  wixUsers . currentUser ;
let  userId  =  user . id ;
let  my_member_id  =  userId
let  memberID  =  userId
$w . onReady ( function  () {
//get the collection records
wixData . query ( “tips” )
. find ()
. then (( result ) => {
const  shuffledArray  =  shuffleArray ( result . items );
//add the shuffled array data to then repeaters
$w ( ‘#tipRepeater’ ). data  =  shuffledArray ;
})
. catch (( err ) => {
let  errorMsg  =  err ;
});
});
//random array index
function  getRandomIndex ( min ,  max ) {
return  Math . round ( Math . random () * ( max  -  min ) +  min );
}
//shuffle array data
function  shuffleArray ( dataArray ){
**for** ( **let**  i  =  dataArray . length  -  1 ;  i  >  0 ;  i --){ 
    **let**  index  =  getRandomIndex ( 0 ,  i ); 
    **const**  temp  =  dataArray [ i ]; 
    dataArray [ i ] =  dataArray [ index ]; 
    dataArray [ index ] =  temp ; 
} 
**return**  dataArray ; 
}