Filter with Multiple Options

Hello,

I have a filter based on 4 dorpdowns: Bedrooms, bathrooms, price min and price max. On my code I have no errors shown. My bedroom and bathroom filter is woring perfectly but my price min and price max is not working. The prices are not been filtered. My dataset price is a number and my values on the fropdowns are numbers as well.

My code is here

import wixData from 'wix-data';

//---------------------------------- USER-INTERFACE --------------------
//var DATABASE        = "RealEstate"  //--> NOT USED HERE
var DATASET         = "#dataset1" 
var REFERENCE1      = "bedrooms" 
var REFERENCE2      = "price" 
var REFERENCE3      = "bathrooms" 
//------------------------------- User-Interface-------------------------------

var itemCount
var totalItemCount

$w.onReady( () => {
  $w(DATASET).onReady( () => {
    console.log($w(DATASET).getCurrentPageIndex())
  } );
} );

export function dropdown1_change(event) {SEARCH_ENGINE()}
export function dropdown2_change(event) {SEARCH_ENGINE()}
export function dropdown3_change(event) {SEARCH_ENGINE()}
export function dropdown5_change(event) {SEARCH_ENGINE()}

async function SEARCH_ENGINE() { 
 let filter =  wixData.filter()  
 let item1, item2, item3, item4

 if ($w('#BedroomDropDown').value!==0)   {item1 = $w('#BedroomDropDown').value}
 if ($w('#bathroomDropDown').value!==0)  {item2 = $w('#bathroomDropDown').value}
 if ($w('#PriceMinDropDown').value!==0)  {item3 = $w('#PriceMinDropDown').value}
 if ($w('#PriceMaxDropDown').value!==0)  {item4 = $w('#PriceMaxDropDown').value}

 if (item1!==0)      {filter = filter.ge(REFERENCE1, item1)} 
 if (item2!==0)      {filter = filter.ge(REFERENCE3, item2)}
 if (item3!=="" && item4!=="") {filter = filter.between(REFERENCE2,item3, item4)}

 await  $w(DATASET).setFilter(filter)

}

I got it!.
on

if (item3!=="" && item4!=="") {filter = filter.between(REFERENCE2,item3, item4)}

I have to make them with the parseFloat function

if (item3!=="" && item4!=="") {filter = filter.between(REFERENCE2,parseFloat(item3), parseFloat(item4))}

Well done goblin :grin:.
Good luck and happy coding!