Hide elements when database field is empty

Hi,

I’d like to hide a container box on my page when a field (breeding) in my database is empty for that item. I’ve attempted to make code for this but I’m not much of an expert at putting code together.

import wixData from ‘wix-data’ ;
$w.onReady( function () {
$w( “#dynamicDataset” ).onReady(() => {

let itemObj = $w( “#dynamicDataset” ).getCurrentItem();

if (itemObj.breeding).value !== “” ) {
$w( “#box21” .collapse()
} else {
$w( “#box21)” .expand()
}

}); 

})

Already tried to use the —> “SEARCH” of this forum ?

https://www.wix.com/velo/forum/community-discussion/count-isempty-values
https://www.wix.com/velo/forum/community-discussion/collapse-if-isempty
https://www.wix.com/velo/forum/community-discussion/issues-filtering-isempty-option
https://www.wix.com/velo/forum/community-discussion/issues-filtering-isempty-option

There are enough posts to get info related to this issue.

Take a look on it.