How to add a random number to a database

If the button1 is the only connected to SUBMIT action of Dataset this won’t work because you can’t have two click events to one button. Then you must choose to code the whole saving process or add a datahook to the data collection onAfterSave and then use like item.randomFieldKey = (Math.floor((Math.random() * 20) + 1)).toString(); and then do an update on the data in the hook.