Stopped working: $w("#myDataset").getCurrentItem();

I’m receiving null with:

let itemObj = $w("#myDataset").getCurrentItem();

/*  
 *  {
 *    "_id":                "fcec780a-3e37-4b64-8a66-37c552c53f99",
 *    "_owner":             "f6c0f9c3-a62d-7e9f-g58d-943829af244d9",
 *    "_createdDate":       "2017-05-01T17:19:03.823Z",
 *    "_updatedDate":       "2017-05-01T17:19:10.477Z",
 *    "title":              "Dr. ",
 *    "name":               "B",
 *    "link-dynamic-name":  "/myCollection/B"
 *  }
 */
 
Now getting null

It was working but it stopped working.

It works with

$w(‘#dynamicDataset’).onReady(() => {

})

But why?

If it was working before but not now, what did you change?

Did you bind the #myDataset to the collection?

I have the exact same issue on a different site, also happened yesterday and still not working today:
https://www.avivbertele.com/AllCourses/Aleph

$w.onReady( function () {
let itemObj = $w(“#dynamicDataset”).getCurrentItem();
console.log(itemObj);
}
});

Returns a null.
didn’t change anything and was working before.

@danielwi I suspect that the problem is that the dataset is not yet ready and therefore there is no current item to return.

You should wrap your code in a dataset.onReady() to ensure the dataset is ready before trying to use it.

It is definitely a BIG glitch it has messed up my site, I had that function implemented in different places and I’m only noticing up until now that where it stopped working. So it’s better the team take a look at it.