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

To complete this thread, I’d like to report that I solved my problems, most probably in a quite unorthodox way.

Since the export function to get me all items counted in my dataset1 was working, I thought just to try to embed my conditionals just below it and do not mess with the on.Ready(), due to problems found with the connection between my 2 datasets.

So I ended up with this:

export function table1_dataChange(event) {
 let count = $w("#dataset1").getTotalCount(); 
        console.log(count)
        $w("#counter").text = String(count);
 if ($w("#counter").text === "1") {
            $w("#text25").show();
            $w("#text12").hide();
 
        } else {$w("#text12").show();
                $w("#text25").hide();
 
        }
}

Smart or dumb, I don’t know, but it finally works. Thanks J.D. and russian-dima for your efforts.