Weird behaviour in using datasets?

Hey
If you make a page with a form and then add a dataset to that page, connecting all fields to the dataset. Then you want all users that come to that page to have a new record from the data collection.

Is is so that you will need to use the below code to make a new clear form, otherwise it will be prefilled with the last entry in the data collection?

$w("#datasetname").new()
  .then( () => {
   console.log("Created a new item in db now");
 
   let item = $w("#entryDataset").getCurrentItem();
   console.log("Created item: " + item._id);
  } )
  .catch( (err) => {
   let errMsg = err;
   console.log("new error " + errMsg);
} );

It should be possible to set a dataset not using code to always use a new empty record?

May not be understanding your question, but I think this is a Permissions or Read/Write issue. If you set those properly, you don’t need to code anything.

Ok so it should be Write Only of you don’t want this issue to happen that it will preload the last item?

You’ll probably need to test it, but yes that would be my gut instinct is that is correct.

If it is Write Only or some combination of the dataset permissions are structured so a user only can perform certain actions, it should accomplish what you need, without code.