How to Hide Elements based off other empty Elements?

I am trying to do a similar thing, but with a button and a link. If the link in the dataset is empty I would like the button to hide. Currently, all the buttons in my code are hiding even though some of them have links. Would love for anyone to show me what I’m doing wrong here -

import wixData from 'wix-data';
$w.onReady(function () {
     $w("#dataset1").onReady(() => {
 var item = $w("#dataset1").getCurrentItem();
 if (item["linkItemTwo"] === undefined)
        $w("#button5").hide();
 else $w("#button5").show() ;
     });
});

PS - linkItemTwo is the column with the links for the buttons