I have a dynamic page set up to show information about individual items in a collection. I want to be able to hide/unhide a star element based on the rarity of the current item, and the rarity is stored as a number value in the database. I want the image (endStar) to hide if the current item’s number value in the rarity field is 4. This is the code I have currently.
$w.onReady(function () {
$w("#dynamicDataset").onReady(() => {
const item = $w("#dynamicDataset").getCurrentItem();
if (item.rarity==="4") {
$w("#endStar").hide();
}
});
});
});
I am not sure what part of this is causing it to not work. I’m very new to coding, so I’m just looking for the easiest way to achieve this.