Dropdown Populated from Dataset and Values Disappear After Selection

Hello,

I have created a dropdown list populated from a dataset. The dropdown list connected to a repeater that filters out videos based on the dropdown list selection. The dropdown list is populated from the same dataset that holds the data for the repeater.

On first load the dropdown list populates as I would expect with 4 values (see below). When I select a value from the list the repeater filters content as expected (see second screenshot).

However, after the repeater applies the filter, the dropdown no longer displays all values in the list, it only displays what I previously selected.

Here is the code i have in the onChange event of the drop down list.

export function dropdown4_change(event) {
//Add your code for this event here:
let filterSpecificExercise = $w(“#dropdown4”).value;
$w(“#dataset1”).setFilter(wixData.filter().eq(“exercise”, filterSpecificExercise))
}

How do I make so the values from the dataset always remain populated in the dropdown list when the selected value is selected?

Thanks in advance!
Jason

Hi Jason,

You have a couple options here: 1) load the dropdown via code or 2) create another dataset tied to the same collection. With the this option, the idea is to connect one dataset to the dropdown and the other, to the repeater. Then, when you filter the repeater, you are not simultaneously filtering the dropdown.

Thanks Anthony. Populating the list with another dataset worked a treat.