Adding multiple photos to gallery

Hi there,
I’m SO excited about Wix Code!!!
It means that I can take my business to a completely new level!
I’ve tried searching, but can’t seem to find any info on how to add multiple pics from my database to one gallery.
On the submit form I created, I have added 3 separate ‘upload’ buttons for images.
In the database they are labelled ‘pic1’ ‘pic2’ ‘pic3’.
On my dynamic page, I can only assign one pic to the gallery via the dataset.
Is there a way that I can assign all 3 fields to the gallery?
Many thanks
Sarah

Im also having the same problem as Sarah.

Hey guys,

This is doable with code.

The idea is to:

  • Query the collection

  • Pull all the image fields from the query results

  • Build a GalleryItem object for each image

  • Set the gallery’s items property to an array of the GalleryItems

Hi guys,

Another option that wouldn’t require writing any code is to use a Repeater instead of a gallery. You could attach 3 images to your Repeater, and then connect each image to a different field in your collection.

Thanks so much!

I have same problem