How do I successfully create multiple real estate search filter (drop down menu filters, search button etc)

Hi Everyone,

This is my very first time learning wix code and it took me 4 days research and watching many videos to created the code as seen in a video most similar to my needs.

The goal is to build a real estate search filter that will allow for selections of a few options such as property type, price no. of bedrooms, location etc as seen in pic.

However code does not work, when in search nothing comes up, this error code shows

Error: Failed to perform query on [RealEstate].
$gte should be a Date, Number, or String. Got null instead
$lt should be a Date, Number, or String. Got null instead

below is my code

import wixData from ‘wix-data’;

export function searchbotton_click(event) {
$w(‘#dataset1’).setFilter(wixData.filter()

        .contains("propertyType", $w('#droptype').value) 
        .contains("status", $w('#dropstatus').value) 
        .contains("location", $w('#droplocation').value) 
        .ge("bedrooms", $w('#dropbedrooms').value) 
        .between("priceBaht", parseFloat($w('#droppricefrom').value), parseFloat($w('#droppriceto').value))) 

    .then((results) => { 
        console.log("Data Set is now Filtered"); 
        $w('#repeater1').data = results.items; 
    }). catch ((err) => { 
        console.log(err); 
    }); 
$w('#repeater1').expand() 

}

(I seem to know what i’m doing up until the .then ((results)), which i copy off from WiX Data Filters - YouTube

Please help fix, Thank you

Hi Prapasson,

One thing that you could do differently is put the number function on the bedrooms dropdown if “bedrooms” is a number field.

.ge(“bedrooms”, Number($w(’ #dropbedrooms ').value))

Hi, Thank you. “bedrooms” is a number field, I tried but it shows red dot error and says number is not defined

Make sure you entered it as Number( rather than number(. It is case-sensitive.

@tony-brunsman
I see, yes Number worked without error but when tested i have additional errors
Error: Failed to perform query on [RealEstate].
$gte should be a Date, Number, or String. Got null instead
$gte should be a Date, Number, or String. Got null instead
$lt should be a Date, Number, or String. Got null instead
*before this only had 2 errors

Were you able to solve this issue? Need help with the same thing

@franklinjtan Im having the same issue,and after weeks of trying I gave up,did you found any solutions?

The error seems like it can not find the value(the number) in the database,but i have the same value,exact same value.

My error:

Dataset is now filtered
TypeError: results is undefined