Filtering gallery used dropdown box

Hello everyone,
I would like to create a filter using a dropbox connected to the database and showing the results in a gallery.
I found this tutorial Velo Tutorial: Adding Collection Data Search Functionality | Help Center | Wix.com

I tried to write this code.

import wixData from “wix-data”;
export function BoxRegion_change(event) {
wixData.query(“Business-people”) //My collection
.contains(“regione”, $w(“#BoxRegion”).value) // the field in the collection and the dropdown box
.find()
.then(res => {
$w(“#TeachersList”) //the gallery
});
}

Could you please tell me where I’m wrong?
Thanks in advance.

 .then(res => { 
$w("#TeachersList").items = res.items;
}); 

Hi J.D.
with your correction it filters, but then the result disappears immediately
depends on what?

Before filter

After filter (and one of these is in Lombardia)

this error marks me

Wix code SDK error: The src parameter of item at index 0 is required for items method.

I don’t know, but maybe you have a record in your collection that has no image and can’t be pushed to a gallery.

If you see the firs photo I published there are two record before use filter and together with images. After filter the record appears and suddenly vanish.

Let’s see what will happen if you modify the query a little bit:

 wixData.query("Business-people")
.contains("regione", $w("BoxRegion").value)
.isNotEmpty("image")
.find()
//etc...

Marco, did you resolve this? I am having a very similar problem and would appreciate any help