How to access nested fields in wixData.filter?

I think you should put the Airport dataset on the page as well (set it via the editor UI to only show 1 item).

Then:

//call it whenever you need (but only after both datasets are ready:
function filter(){
$w('#airportDataset').setFilter(wixData.filter().eq('code', 'SLC'))
.then(() => {
const originId = $w('#airportDataset').getCurrentItem()?.id;
$w('#mainDataset').setFilter(wixData.filter().eq('origin',originId))
})
}