Can not update database today

Any known errors? I just created an article page and did the Bolden Academy Heart and Views functions on it. I can’t reach the currentItem if I just declare it as a var in the top on code so I had do redo some stuff.

But however I try fixing this I can’t update the number fields, no errors, it just don’t update the record.

Any ideas?

I attached a video on my whole setup here:

Hi Andreas,
thank you for the report, we are investigating the issue.

Hi Andreas,

It seems that the dataset is not ready yet when you click the button.
To verify my assumption, can you please wrap the code in the button event handler with a dataset onReady function?

So I changed the code to

export function blackHeart_onClick(event) {
	$w("#dynamicDataset").onReady( () => {
	ds = $w("#dynamicDataset");
	currentItem = ds.getCurrentItem();
	$w("#blackHeart").hide();
	$w("#redHeart").show();
	let votes = currentItem.voteCount + 1;
	ds.setFieldValue('voteCount',votes) ;
	ds.save();
	
	$w('#thankyoubox').show('SlideIn');
	});
	
}

But it does not affect the not updating issue I am afraid. The dataset should be ready because the article itself is presented on screen with no problems accept a bit slow in loading the image on top.

Do you have any errors in the console?

We identified an issue that could happen when working in the editor, we’re looking into it.

Sometimes error that could not filter undefined but I dont know What causes it

Can you link to the published site so I can play with it as well?
A clone of your site works fine for me.

https://www.wixsweden.se/Artiklar

I get a permissions error, is the relevant collection blocked for anonymous user changes?

Collection yes but not dataset

It means that an anonymous user, myself for example, can’t change the data on the page. So this is either the original problem of data not changing, or I can’t check the original problem. I hope I’m clear enough :slight_smile:

Ok so I have misunderstood the database security option we have. I thought settings permissions on the actual collection is setting up access to the Database itself for users on the WIX Dashboard. Setting permissions in the dataset on page will set the permissions on that database on that page.

So what does the dataset permission functions do when the collection permission is the one you have to setup correctly?

It’s more of the mode of the dataset rather than permissions. It states what can the user do, rather than who can do it (which is set in the collection permissions).
You can read more about it here: CMS: Working with Dataset Connector Modes and Collection Permissions | Help Center | Wix.com