I have a dynamic item page containing an image linked to the dataset. The dataset has a FieldX. If FieldX = “YES” I want the iamge to show; otherwise, I want it hidden.
this is the code i have already and it hides the image but doesnt show it
$w.onReady( function () {
$w(“#dynamicDataset”).onReady(() => {
let activeDynamicItem = $w(“#dynamicDataset”).getCurrentItem();
let fieldX = activeDynamicItem[“Show”];
if (fieldX && fieldX ===“Show”) {
$w(“#image14”).show();
} else {
$w(“#image14”).hide();
}});
});
Can someone please show me what i need to do to the code to make it work? I’ve been unable to adapt the code myself.
Thanks