When do emails execute? Before or after form rules?

Does anyone know when emails are sent out? I want emails to only be sent once on a form, but the form may be utilized numerous times. If emails are sent before form rules I can just add a field that the email has been sent.

If form rules are executed before an email is sent, does anyone have a work around to only send an email one time?

Unfortunately for your scenario the record rules are executed before the email and so the email would not send.

However, there is a way round this which involves:

  1. Send the email from your existing form with the criteria Email Sent is not Yes
  2. Configure the Submit rule to open a new child form which edits the same record (probably open as a popup for neatness). This form needn't have any fields on it - just the submit button and you could rename it - or you could add some text to tell the user it's updating.
  3. In this new form have a record rule which updates the Email Sent field to Yes.

The downside so far is that this new form needs to be submitted which is a pain - however you can get it to Auto Submit with the following Javascript:

$(document).on('knack-view-render.view_191', function(event, view, data) {
$('button[type=submit]').submit();
});

Note '191' above should be replaced with the view number of your view. Also, this code is for the new Standard Theme.