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

Hi Helena

Your page is flagging that itemData is undefined and so an error and the reason why is that the dataset onReady function doesn’t deliver any arguments to the handler function.


Sorry I should have picked this up earlier. You have to get the item data using the getCurrentItem() function.

So replace this code:

$w("#dynamicDataset").onReady( ($w, itemData, index) => {
    console.log(itemData.document);

with

$w("#dynamicDataset").onReady(() => {
    let itemData = $w('#dynamicDataset').getCurrentItem();
    console.log("Dumping current itemData");
    console.log(itemData);

This should get you to (or closer to) a solution :wink: