Filter repeters linked to different datasets with dropdown menus

Hello,
I’m trying to display comparative repeaters linked to different datasets. So people can filter a repeater via an input box and the other via a dropdown menu. I can link one, but when I start linking the second it generates a series of issues.

here is the link to the website at the moment https://lcbgroup.wixsite.com/testenergyrev/copy-of-energy-profile

This is the coding I have so far

import wixData from 'wix-data';

$w.onReady(function () {

});

let debounceTimer;
export function inputEmail_keyPress(event, $w) {
 // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
 // Add your code for this event here: 
 if (debounceTimer) {
        clearTimeout(debounceTimer);
    debounceTimer = undefined;
    }

    debounceTimer = setTimeout(() => {
        filterbyemail($w('#inputEmail').value);
    }, 200);
}

 let lastFilterTitle;

 function filterbyemail(title) {
 if (lastFilterTitle !== title) {$w('#dataset3').setFilter(wixData.filter().contains("email", title));
 
    }
}

export function dropdownPostcode_change(event, $w) {
 // This function was added from the Properties & Events panel. To learn more, visit http://wix.to/UcBnC-4
 // Add your code for this event here: 
        filterbypostcode($w('#dropdownPostcode').value);
}
 function filterbypostcode(title2) {
        $w('#dataComparison').setFilter(wixData.filter().contains("postcode", title2));
    }

The filterbyemail works fine. But the filterbypostcode breaks after the first use, it only shows the values selected the first time, with the following error ‘cannot update field values: index not found’

I will appreciate any help

Cheers!

Pablo

I solved this issue by creating a duplicated database and linking the dropdown menu to that dataset. Thus, when one dataset was filtered it didn’t affect the drop down options