Display calculated number in a text field

Some Update to my problem:

apparently the main problem seems to be that the data I wish to display are “null or undefined”. As the database is definitely not empty, I tried to display elements of this database in the regular manner (only connecting the text element with the data and not using the afterQuery hook). This works great. As also the afterQuery hook works great (after form submission, the input data appears in the database and all numbers have been calculated from the input number, as defined in the afterQuery hook), the problem needs to be in my onReady function:

$w.onReady( function () {
//TODO: write your page related code here…

$w(“#dataset1”).onReady(() => {
populateCalculatedFields();
} );
} );

function populateCalculatedFields() {
const currentItem = $w(“#dataset1”).getCurrentItem();

$w(“#text40”).text = currentItem.priceBasic.toString();
console.log(currentItem)
}

Checking wix articles, I found the following article, that the problem might be the getCurrentItem() function:

The article says, the getCurrentItem() function returns “null or undefined” if the dataset is empty (this is not the case), is filtered (this is also not the case), or has not loaded yet. As the first to reasons can be excluded, the problem needs to be that the dataset has not loaded yet. I just wonder, why? I already applied the wix suggestion to put the dataset’s onReady function into the page’s onReady event handler. Furthermore, I waited a long time for loading. Both did not solve the problem. Furthermore, as soon as I go the preview, the following error appears:

An error occurred in one of datasetReady callbacks TypeError: Cannot read property ‘toString’ of undefined

Indicating, that directly “undefined” is returned as soon as the preview is opened.

Can somebody help me with this problem? Maybe also someone from the wix team? That would really help a lot…

Thank you so much!
NH