Events: What is the difference between the "Do" and "On" events?

Hi!

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?

1 Like

Hi TheMaskedDev,

We have a number of events that can be executed for a form and use this link to find a quick overview of each event Introduction to Form Events | Five | Low-Code For Real Developers.

The difference between ‘On’ and ‘Do’ events is the ‘On’ events will execute on the client while the ‘Do’ events will execute on the server.

1 Like

Thanks for your response.

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.

Hi TheMaskedDev,

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.