Dataset not filtering on ready

On the homepage of my client’s site, I have 3 dropdown options that they can use alongside a button to take them to the page that needs filtering.

They can choose any selection of the three dropdowns, Just 1, 1+2, 1+3, 1+2+3 etc.

The code on the homepage is working, I have checked that all of the values are storing correctly.

The search page dropdowns are working, as they are showing the values from the homepage, however, the actual filtering isn’t being executed. Any help appreciated.

Home Page:

export function searchButton_click(event) {
            if ($w('#stateProvince').value.length > 0) {
                let stateProvince = $w('#stateProvince').value
                session.setItem("stateProvinceSearch", stateProvince)
            } else {
                let stateProvince = undefined
                session.setItem("stateProvinceSearch", stateProvince)
            }
            if ($w('#city').value.length > 0) {
                let city = $w('#city').value
                session.setItem("citySearch", city)
            } else {
                let city = $w('#city').value
                session.setItem("citySearch", city)
            }
            if ($w('#industry').value.length > 0) {
                let industry = $w('#industry').value
                session.setItem("industrySearch", industry)
            } else {
                let city = $w('#city').value
                session.setItem("citySearch", city)
            }
            
            let searchFromHomePage = +'1'
            session.setItem("searchFromHomePage", searchFromHomePage)
            
            wixLocation.to("/properties");
}

Page that does the filtering:

$w.onReady(function () {

    $w("#propertiesDataset").onReady(() => {
        let industrySearchResult = session.getItem("industrySearch");
        let citySearchResult = session.getItem("citySearch");
        let stateProvinceSearchResult = session.getItem("stateProvinceSearch");
        let searchFromHomePageResult = session.getItem("searchFromHomePage")

        $w("#stateProvince").value = stateProvinceSearchResult
        $w("#city").value = citySearchResult
        $w("#industry").value = industrySearchResult
        $w("#text200").text = searchFromHomePageResult

        if ($w("#text200").text === '1') {
            var searchStateProvince = $w('#stateProvince').value
            var searchCity = $w('#city').value
            var searchIndustry = $w('#industry').value

            let filter = wixData.filter()

            if (searchStateProvince) {
                filter = filter.eq("stateprovince", searchStateProvince)
            }
            if (searchCity) {
                filter = filter.eq("city", searchCity)
            }
            if (searchIndustry) {
                filter = filter.hasAll("industry2", searchIndustry)
            }

            $w("#propertiesDataset").setFilter(filter)
                .then(() => {
                    session.clear();
                })
});

Anyone got any ideas or help?

What is this —> let searchFromHomePage = + ‘1’ <— ???
The new style how to put a NUMBER into a variable ?

However, it doesn’t even matter, if you put a → NUMBER<–, or a → STRING ← into the → SESSION-STORAGE!

At the end you will get —> a —> STRING!

import wixStorage from 'wix-storage';

$w.onReady(function () {
    let searchFromHomePage1 = 1; 
    console.log(searchFromHomePage1+" / "+typeof searchFromHomePage1);
    wixStorage.session.setItem("searchFromHomePage", searchFromHomePage1);
    let result = wixStorage.session.getItem("searchFromHomePage");
    console.log(result + " / " + typeof result);
});

How to generate NUMBERS? →

let myNumber = Number("1");

How to generate STRINGS ? —>

let myString = String(1);

Try this one…

$w.onReady(function() {
    $w("#propertiesDataset").onReady(() => {
        //------------------------- declaration-process of variables--------------------------------------
        let searchIndustry = session.getItem("industrySearch");
        let searchCity = session.getItem("citySearch");
        let searchStateProvince = session.getItem("stateProvinceSearch");
        let searchFromHomePageResult = session.getItem("searchFromHomePage");
        //------------------------- declaration-process of variables--------------------------------------

        // ----------- filling of DropDowns -------------------------------------------
        $w("#industry").value = searchIndustry;
        $w("#city").value = searchCity;
        $w("#stateProvince").value = searchStateProvince;
        $w("#text200").text = searchFromHomePageResult;
        // ----------- filling of DropDowns -------------------------------------------

        if ($w("#text200").text === searchFromHomePageResult) {
            let filter = wixData.filter()

            if (searchStateProvince) {filter = filter.eq("stateprovince", searchStateProvince)}
            if (searchCity) {filter = filter.eq("city", searchCity)}
            if (searchIndustry) {filter = filter.hasAll("industry2", searchIndustry)}
            $w("#propertiesDataset").setFilter(filter).then(() => {session.clear();});
        }
    });
});

Just the following one seems to be strange…

if ($w("#text200").text===searchFromHomePageResult){.....

Why not also directly …???

if (searchFromHomePageResult === "1"){......