Prerequisites
- Ensure that all survey names, schedule names, event names, group type names, and group name fields are named correctly.
- Ensure that the survey and schedule are already created. See Configuring Surveys for more information.
Create a Rule Template
Complete the following steps to create a rule template:
- In eCOA Studio, open the Rules tab.
- Select Create Rule.
- In the Rule Templates dialog box, select Survey-based Notification **and select **Select Template. A new rule template for survey-based notifications opens.
- Enter a name for the rule in the Name field. For example: Rule_1
- Enter a description of what the rule is for in the Description field to help other Studio users identify what the rule is when they see it in the Rules tab. For example: This rule enables you to receive notifications when a user answers certain questions on a survey.
- Create a reference for the survey that should trigger the rule evaluation. When the reference survey conditions are met, the system will automatically evaluate the expression provided in the rule template. For example:
$survey.hads.[*].[*].[*]
See Creating a Reference on the Understanding Rules page for more information.
Tip: Enter $ or @ to begin, and then select from the options that are displayed. After you select each option, enter a period and select from the next list of options that are displayed.
- Optionally, define the precondition using references or variables, and add the data you want to evaluate. For example:
@survey.hads.[*].[*].[-1].status = "COMPLIANT"
- In this example, adding the following precondition ensures that a rule only runs when the most recent submitted survey is compliant. See Creating a Reference and Creating a Variable on the Understanding Rules page for more information.
Note: The system will not evaluate the rule expression unless the defined conditions are true.
- Using Vault expression engine syntax, create an expression that evaluates to TRUE or FALSE. Only references that evaluate to TRUE will cause the action to run. See Creating an Expression for more information. For example:
IF((Q1ANS = "3") || (Q2ANS = "3"), true, false)
Note: In the example above, the Q1ANS variable will check whether the first question, HADS0101, is Most of the time (answer name 3), OR it will use the Q1ANS variable to check whether the answer to the second question, HADS0102, is Hardly at all (answer name 3). If either of those are true, then the expression will evaluate as true.
- Enter a name in the Notification Name field. Example: hads_notification_1
- Select Site Staff or Email Address from the recipient list. If you selected Site Staff, continue to Step 11. If you selected Email Address, skip to Step 12.
- Select all roles you want to receive the notification from the Role Type list. Skip to Step 14.
- In the Email Address(es) field, enter the email addresses that you want to receive notifications. For example: person.1@veeva.com,person.2@veeva.com
Tip: As a best practice Veeva recommends using a listserv email addresses instead of individual emails so you can update email recipients without upversioning your collection.
- In the Testing Email field, enter the email address you want to use during UAT. When in UAT, this email address will receive any rule-triggered emails instead of the addresses listed in the Email field. For example: test.person@veeva.com
- Enter the title you want to be displayed with the notification in the Title field. For example: Survey answer exceeds threshold for
- Enter the body message of the notification in the Body field. For example: The HADS response for in the has answered a question with a response that requires additional attention.
- To prevent users who do not have permission from seeing restricted data, select the Yes option under Restricted Data.
Note: If any of the surveys referenced in the rule collect restricted data, the Yes option is automatically selected. If a referenced survey is later updated to be restricted, the restricted value here is automatically updated too. This setting is inactive if no restricted surveys are referenced in a rule template.
- Select Save.
- Select Add Another and repeat Steps 9 through 17 to add additional notifications.
- Select Save & Exit.
Saving a Rule
Draft template changes are automatically saved as you make updates. If you sign out and back in, when you access the templates, you can continue working on your draft. If you choose to create a new draft before manually saving an in-progress draft, your changes will be lost.
You can save a rule by selecting the Save button.
Editing a Rule
You can edit a rule when the collection is in a Draft state.
Complete the following steps to edit a rule:
- Open the collection, select the Rules tab, and select the Edit Rule icon () next to the rules you want to edit.
- Make any changes you want to see, and select Save. Your changes are saved.
Deleting a Rule
You can only delete rules that have not been included in an approved collection. Once a rule is deleted, it cannot be recovered.
Complete the following steps to delete a rule:
- Open the collection, select the Rules tab, and select the Delete Rule icon () next to the rule you want to delete. A confirmation box opens.
- Select Delete. The rule is deleted.