Gallery Filtering of Dataset into Gallery not functioning fully.

I have implemented a set of data filters (category, event type etc) for an artists database i have created on this entertainment website (see link below).

https://owen0106.editorx.io/website-32/blank-2-1

You will see I have created multiple dropdown options including all, party bands etc for the category filter. This filter then works in showing some resulting artists. However, it misses out a substantial amount of artists that are linked with these category fields in the database.


// Category

$w.onReady(function () {
 //TODO: write your page related code here...

});

export function iCategories_change(event, $w){
 $w("#dataset1").setFilter(wixData.filter()
     .contains("category", $w('#iCategories').value)
     .contains("eventType", $w('#iEventType').value)
     .contains('tags', $w('#iSearch').value)
     .contains('genre', $w('#iGenre').value)
     .ge("costs",parseFloat($w('#iPriceFrom').value))
     .le("costs",parseFloat($w('#iPriceTo').value)))
 
    .then((results) => {
      console.log("Dataset is now Filtered");
   $w("#gallery1").data = results.items;
     })
  .catch((err) => {
   console.log(err);
  });      

 $w("#gallery1").expand();

}

Above is the snippet of code I have used to filter the dataset(artist) results into the gallery from the dropdown menu choices I have created.

I have also noticed that the .data code (highlighted in orange on snippet) shows a fault as ‘data does not exist on gallery 1’. Could this be the reason why only some of the filtered artists display in the gallery and not all?

Any help will be greatly appreciated as this is the last hurdle to navigate before the website goes live.

Thanks,
Owen

Hello.

Note that .data is a repeater property. For a gallery you need to use .items: https://www.wix.com/corvid/reference/$w.Gallery.html#items

I can see that you are using and() condition to chain your database filters. If you wish to check for all the available categories check out or() condition here:
https://www.wix.com/corvid/reference/wix-data.WixDataQuery.html#or

Good luck!