Type error'Cannot read property 'forEach' of undefined'

In order to create a dynamic slideshow on Editor x i followed these steps:

  1. I added a progallery and named it ‘#dynamicSlideshow

  2. Added a text1 and named it ‘#slideTitle0

  3. Added a text2 and named it ‘#slideDescription0

  4. I created a database named ‘DynamicSlides’ with 3 fields ‘Title’(text),‘SlideBackground’(image) and ‘description’(text)

  5. I added the following code in dev mode:

  6. import wixData from ‘wix-data’ ;

$w . onReady ( async function () {
let slidesData = await getSlideshowDataFromDatabase ();
loadSlideshowData ( slidesData );
});

function loadSlideshowData ( slidesData ) {
const slideElements = $w ( “#dynamicSlideshow” ). slides ;
slideElements . forEach (( slide , index ) => {
$w ( # ${ slide . id }). background . src = slidesData [ index ]. slideBackground ;
$w ( #slideTitle ${ index }). text = slidesData [ index ]. title ;
$w ( #slideDescription ${ index }). text = slidesData [ index ]. description ;
$w ( #slideButton ${ index }). link = slidesData [ index ]. buttonUrl ;
})
}

function getSlideshowDataFromDatabase () {
return wixData . query ( “DynamicSlides” ). find (). then ( results => {
return results . items ;
})
}
I got back type error ‘Cannot read property ‘forEach’ of undefined’ can someone help me to solve this? Many thanks

@ibletsos , you might want to post this question on the Velo forum: https://www.wix.com/velo/forum/coding-with-velo

Ok Thanks!