I have a question on “Events” in relation to forms. I have figured out Events on a form field (on enter, on exit, etc.), but I don’t fully understand events on Forms.
Is there more documentation available on this, especially the difference between “Do” and “On” events?
What I would like to happen in my application is that users automatically get an email after they’ve filled in a form. Should I select OnComplete or DoComplete for this?
Can I use the OnCancel event to send an email to users that have started filling out a form, but then abort it? I’d like them to receive a reminder email to nudge them to go back into the form to fill it out completely.
The Do Complete event would be the event you would use to send out an email when a user has submitted a form, as this event guarantees the form is going to be saved. The Do Complete event is the final event to be called when saving a form. The video below demonstrates calling a mail merge using the Do Complete event when a form is submitted.
In regard to your second question, yes, you can use the On Cancel event to send out an email. The On Cancel event for a form is only available in the browser, so two functions need to be written. One of the functions will be executed in the front end, which will call the function in the backend. The frontend function needs to be attached to the On Cancel event. The video below demonstrates calling a function in the backend from a frontend function to execute a mail merge.