(SOLVED) - What am I missing? (syntax problem?)

@russian-dima Okay. I fixed it. And I didn’t fix it.

a) I fixed it.
Dataset 1 is connected to Dataset 2 via a referenced field which I use as a Filter.


If I delete this filter, the code works. Again, to remind you, the filter above does not do any bad to this:

export function table1_dataChange(event) {
 let count = $w("#dataset1").getTotalCount(); 
        console.log(count)
        $w("#counter").text = String(count);
}

This works with or without the Dataset filter. It only affects this:

$w.onReady (function() {
    $w("#dataset1").onReady(() => {
 let count = $w("#dataset1").getTotalCount(); 
        console.log(count)
        $w("#counter").text = count.toString()
 
 if ($w("#counter").text === "29") { 
                $w("#text29").show();
        }
 else {
        $w("#text26").show();
        }
    })
});
  1. I didn’t fix it.
    But if I delete this filter, my dropdown menu stops working… How can I include both my datasets in the on.Ready()? I mean, what would be the syntax?