# link multiple images from collection to gallery

**URL:** <https://forum.wixstudio.com/t/link-multiple-images-from-collection-to-gallery/39469>\
**Category:** Ask the community\
**Tags:** question, code\
**Created:** [April 14, 2018, 9:12pm UTC](https://forum.wixstudio.com/t/link-multiple-images-from-collection-to-gallery/39469 "2018-04-14T21:12:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yafim-simanovsky](https://sea1.discourse-cdn.com/wix/user_avatar/forum.wixstudio.com/yafim-simanovsky/32/1538_2.png) [@yafim-simanovsky](https://forum.wixstudio.com/u/yafim-simanovsky)\
**Post date:** [April 14, 2018, 9:12pm UTC](https://forum.wixstudio.com/t/link-multiple-images-from-collection-to-gallery/39469/1 "2018-04-14T21:12:18Z")

</div>

I have a collection with 3 fields, each with 1 image.  
I want to link a gallery on a dynamic page to the collection images.

I’ve tried placing the code that Yoav gave as an example [here](https://www.wix.com/code/home/forum/questions-answers/connecting-gallery-images-to-image-fields-in-database)  
My attempt is:

```javascript
export function dynamicDataset_onReady() {
  let item = $w('#dynamicDataset').getCurrentItem();
  $w('#gallery1').items = [
    {src: item.image1},
    {src: item.image2},
    {src: item.image3}
  ];
}

```

but nothing is happening in the preview page.  
There are no console messages.

I think perhaps I’ve neglected an import statement, or maybe I’m placing the code altogether in a different page… right now it’s on the ‘page’ tab of the code editor in the dynamic page.

Any help would be appreciated.  
Thank you.

---

<div class="post-metadata">

**Author:** ![cebupropertyoptions](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@cebupropertyoptions](https://forum.wixstudio.com/u/cebupropertyoptions)\
**Post date:** [April 15, 2018, 4:18am UTC](https://forum.wixstudio.com/t/link-multiple-images-from-collection-to-gallery/39469/2 "2018-04-15T04:18:22Z")

</div>

I have similar concerns. Im also using that code but same result as yours. I have also post like this 1 week ago in the forum, but until now still has no answers.
