Problems with dynamicDataset

Hi, suddenly gives me the following error on the statement

TypeError: Cannot read property ‘squadra’ of null

I also tried to reconfigure the dynamic Page but it’s the same thing.
Other dynamic pages that I have on the site are ok.

Anyone have any idea what could have happened?
Thanks and sorry for my the bad english

Claudio

$w.onReady(function ()
{
    $w("#text243").text = $w("#dynamicDataset").getCurrentItem()["squadra"];
}

Hello, Claudio.

You can try to put your code in the onReady() function of the dataset so that you pull the data from the dataset when it is fully loaded.

You can check out the API Reference: https://www.wix.com/corvid/reference/wix-dataset.Dataset.html#getCurrentItem showing how to get the dataset’s current item when the page loads:

Having the same problem, has anything changed? All was fine, now some pages not working

However, I also followed your advice but I understand the problem.

I had lost, I don’t know how, the filter option with another dataset, in to Dataset Setting .

See image

Thanks for the support, best regrads

thank god im not the only one yes im having the same issue, has been happening since yesterday and everything was working fine for months on my code i thought i was going crazy . i get a typeError: cannot read the property ‘_id’ of nul l. i posted this in another post on here btw just trying to get all the help i can

Hi! Same problem. getCurrentItem doesn’t receive data from the database. I created a simple site with simple code, but this doesn’t work.


import wixData from "wix-data";
$w.onReady(function () {
let textFromDatabase = $w("#dataset1").getCurrentItem().title;
$w("#text1").text = textFromDatabase;
});

Please fix this as soon as possible.

There is nothing to fix. The way you have written the code is wrong here. You should be putting the .getCurrentItem() under a Dataset onReady() function as Anastasiia mentioned above.

$w.onReady(function () {
   $w("#dataset1").onReady( () => {
      let textFromDatabase = $w("#dataset1").getCurrentItem().title;
      $w("#text1").text = textFromDatabase;
   });
});

Please open a new thread and post the code you are using

Please open a new thread and post the code you are using

Original question was answered and solved. If anyone has a similar issue please open a new thread and post the code you are using. Closing to avoid bumps.