the current form submits, but needs to update as well. cf. the below:
Can I reuse the same quickForm or autoForm for both inserts and updates?
Yes. Your code that flips between states should do the following in this order:
Change the type attribute's value to "insert" or "update" as appropriate, probably by updating a reactive variable. Change the doc attribute's value to the correct document for an update or to null (or a document containing default values) for an insert, probably by updating a reactive variable. Call AutoForm.resetForm(formId). This will clear any existing validation errors for the form.
the current form submits, but needs to update as well. cf. the below: