This isn't a good way to do it since you could have two people submit at the same time.
My recommendation is to submit the form and then query the SharePoint list to get the ID for the submitted form and set a field in your form and then submit again. In other words, your Submit button will do a submit, query, set and then another submit.