insert and update depending on if the user has submitted information before

You need a record id in your toUpdate object. Also be aware that if you don’t include previous data in your toUpdate, it will get overwritten. update - Velo API Reference - Wix.com