Filtering a duplicated gallery

I have a gallery with 4 buttons that act as filters for the gallery (only show dogs, only show cats, etc.) This has been working fine.

I want to show the gallery and 4 filter buttons multiple times on the same page. The code that was working with a single gallery isn’t working as intended with multiple galleries.

This line was working. $w ( “#dataset1” ). setFilter ( wixData . filter (). contains ( ‘type’,‘dog’ ));

This line won’t filter anything and I can’t figure out why. The ID for the second gallery is dataset2
$w ( “#dataset2” ). setFilter ( wixData . filter (). contains ( ‘type’,‘dog’ ));

Thanks in advance!

You need a second dataset that’s connected to the second gallery I’d guess that the first gallery isn’t called dataset1, rater that’s the name of a dataset connected to the first gallery.

Thanks, that did the trick!