Sorting and filtering a collection

Hi all.
First post here, so be gentle :slight_smile:

I am trying to show some guides on my website.
I have created this collection:

Now I want to be able to choose to only display items of a certain kind on the page.
Example:
I choose “LAN” from the dropdown menu, and then it tells the repeater to only show those with the “LAN” tag in the “Kategori” column.

My page looks like this at the moment:


I simple repeater and dropdown input, connected to the dataset.

How do I do this?

Kind regard
Sebastian Uth

Found a solution myself :slight_smile:

If anyone has the same question in the future, here is what I did:

import {wixData} from ‘wix-data’;

export function button20_click(event, $w) {
$w(“#dataset1”).setFilter(wixData.filter()

 .contains("kategori", $w('#dropdown').value)) 

.then((results) => {
console.log(“Dataset is filtered”);
$w(“#repeater1”).data = results.items;
});
$w(“#repeater1”).expand();
}

2 Likes