[Solved] Image icon/tag showing although dataset field is empty

One last thought there is another error that is being generated because you are probably binding the itemData.image field to the $w(‘#image’) using the icon in the editor. What you might want to consider is doing the binding in this code block also using $w(‘#image24’).src.

So unbind the editor mapping and change your code to look like this:

$w.onReady(() => {
    $w("#repeater1").onItemReady( ($w, itemData, index) => {
        console.log(itemData.image2);
        if(itemData.image2 && itemData.image2.length > 0) {
            // We have an image assign it to the element for display
            $w("#image25").src = itemData.image2;
            $w("#image25").show();
        } else {
            $w("#image25").src = ''; // No Image - do not use null
            $w("#image25").hide();
        }
        console.log(itemData.image3);
        if(itemData.image3 && itemData.image3.length > 0) {
            // We have an image assign it to the element for display
            $w("#image24").src = itemData.image3;
            $w("#image24").show();
        } else {
            $w("#image25").src = ''; // No Image - do not use null
            $w("#image24").hide();
        }
     });
     $w("#dynamicDataset").onReady( ($w, itemData, index) => {
         console.log(itemData.document);
         if(itemData.document.length > 0) {
             $w("#button4").show();
         } else {
             $w("#button4").hide();
         }
     });
  });