I have a dataset #dataset5 which is connected to a collection of which one of the categories is “Name”.
I am trying to filter the dataset based on the value of a dropdown list.
When the page loads, the repeater connected to the dataset populates as expected.
When the user makes a choice from the drop down, the repeater disappears… which to me suggests that the dataset is empty, although I know it shouldn’t be.
Here is the code in question:
function filter(){
let newFilter = wixData.filter();
newFilter = newFilter.contains("Name", "Tree");
$w('#dataset5').setFilter(newFilter);
}
export function plantType_change(event) {
filter();
}
I used “Tree” in the third line to remove the possibility of the error coming from my use of the dropdown value.
Here is a screenshot of the table to show that the filtered dataset should not be empty:
In addition I have tried changing the filter type from “contains()” to “isNotEmpty( )” . Same deal.
Would love some help here.
Thanks;