Random picture with corresponding data from database on a dynamic page

What you shoild do.
Combine this:

if (wixWindow.rendering.renderCycle === 1) {
let res = await wixData.query("vocabulary")
.find();
let items = res.items;
let count = items.length;
let rnd = Math.floor(Math.random() * count);        
$w('#image1').src = items[rnd].image;     
}});wixData.query("vocabulary")  
.find()  
.then( (results) => {
let randomNumber =  Math.floor((Math.random() * results.items.length)); 
let randomItem = results.items[randomNumber];    })

Into one function.
As i told you, u are using 2x a different random number.

1 called rnd
1 called randomNumber.

Make sure you only use 1 random number.
If you canโ€™t figure it out tomorrow i wil change the code for you but you will better understans if you try yourself :slight_smile:

Kind regards,
Kristof.