Givemeawhisky (thanks to him) advised to look in the Wix API Reference. There is a very important rule: “Setting the value of a field in a dataset item does not immediately set that value in the collection that the dataset is connected to. You still need to call the dataset save() function or any other function that performs a save to have the new value reflecting in the collection. "
Therefore add: $w (”#dataset1"). save ();