Checkboxgroup does not filter the data properly

hi! I am creating a dynamic product page where I need to show accessories in a multicheckbox. Accessory&Price may vary depending on the bike and the City, BikeModel and Plan selected.

plan = $w ( “#dropdown1” ). value . toLowerCase ();
model = $w ( “#dynamicDataset” ). getCurrentItem (). modeloText . toLowerCase ();
city = $w ( “#dynamicDataset” ). getCurrentItem (). ciudadText . toLowerCase ();

$w ( “#dataset6” ). setFilter ( wixData . filter ()
. eq ( “planelegido” , plan )
. eq ( “modeloText” , model )
. eq ( “citytext” , city )

The checkboxgroup is connected to dataset6 that should show the exact quantity of accessories for each plan, model and city. Instead, the checkbox group is showing ALL the different unique values that we have per city and model.

I connected the same dataset with a repeater and this one actually shows the correct items, so IDK if it´s an issue with checkboxgroups. Should I use normal checkbox with repeaters instead?

Thanks!

the dynamic page is already at the bike and model level. So the customer only selects the plan via dropdown

Still not complete… but much better…

$w.onReady(()={
  $w("#dynamicDataset").onReady(()=>{
	$w("#dataset6").onReady(()=>{
	
		let currentItem = $w("#dynamicDataset").getCurrentItem();
		console.log("Current-Item: ", currentItem);
		let plan = $w("#dropdown1").value.toLowerCase(); 
		console.log("Plan: ", plan);
		let model = currentItem.modeloText.toLowerCase();
		console.log("Model: ", model);
		let city = currentItem.ciudadText.toLowerCase(); 
		console.log("City: ", city);
		//------------------------------------------
		$w("#dataset6").setFilter(wixData.filter()
		.eq("planelegido", plan)
		.eq("modeloText", model)
		.eq("citytext", city)

	});
  });	
});

Try to get it to work.