Create a rule to send an email notification

You can notify designated team members by creating a rule that sends an automatic email notification when specific criteria is met. The usual steps for creating and managing custom rules still apply.

You can also create a rule that calculates a value for use in a form or generates an automated query. See:

Caution:

Make sure you do not include any personally identifiable information (PII) data in the body of your email notification.

Note:

In Draft mode, study designers can additionally create a rule to send notifications upon data entries and response changes. Reach out to your study design team or see Define a Send Notification rule.
You must have a study version in the Testing container that includes the required elements. You access the Rules interface from a specific study version and site as described in Access the rules interface.
To create a rule to send an automatic email notification:
  1. Navigate to your desired study in Testing mode and select a site (if you have access to multiple sites).
  2. In the table, locate and click the visit card that you want to edit.
  3. On the left, click the form for which you want to create the rule.
  4. Select the question that should contain a rule.
  5. On the right, expand the Rules pane, and click Add Rules.
  6. In the Rule editor complete the following fields. Then click Next.
    Field Description
    Rule Name

    Enter a name for your rule. Each name must be unique within a study and its number of characters should not exceed 512.

    Description

    Enter a short description of your rule that doesn't exceed 4000 characters.

    This field isn't mandatory. However, adding a description can help you distinguish between each rule and its purpose in a study. This is helpful when you want to reuse a rule.

    Unblock Form

    Turn this toggle on if you want to allow site users to edit and save forms without being blocked while the rule is running.

    Note:

    Complex rules take more time to run. Site users can still enter values and save the form while the rule is running. However, form updates generated by complex rules can be delayed and may only appear after a page refresh.
  7. In the Variable section, Define rule variables.
  8. In the Expression section, enter the JavaScript expression that will be evaluated to send a notification.

    Note:

    By default, the rule will run against every visit in the study that contains the form and in all study versions.

    Tip:

    A predictive text feature is available as you type, with available Subject attributes, rule helper functions, and more. See Use predictive text to write rules.
  9. From the Action drop-down, select Send Notification.
  10. In the Subject Line field, write a subject for your notification email.
  11. Type the email addresses you want to send this notification to in the text box underneath the Action drop-down.
  12. To test the email notification, type the email addresses you want to send the notification to in the appropriate text box for testing email addresses.

    Note:

    Any email addresses will receive a notification when the rule is generated either in Testing or Production mode.
  13. Write the notification message you want the users to receive.
    Notification details will always be included in the email below the notification message.
  14. Click Save.
To make your rule available in production. You must test, approve, and publish your rule. Rules are study version independent and will apply in every mode once they reach the Published state.

If you want to delete this rule and start over, click the menu icon (Rules menu icon), select Delete.

For examples, and more information on developing custom rules, see: