This rule template allows you to define a rule that can use data from a submitted survey to automatically trigger a new schedule. This enables surveys to be triggered by previous survey completion or a specific answer value, instead of only by a start event.
Prerequisites
- Ensure that the survey and schedule you plan to use are already created.
- The event you want to populate is set up with a Populated By: Rule. The system will not let you create this rule template if no events are configured this way.
- Ensure that all survey names, schedule names, event names, and group names are correct.
Create Schedule Trigger Rule
- In eCOA Studio, open the Rules tab.
- Select Create Rule.
- In the Rule Templates dialog box, select Schedule Trigger and select Select Template. A new rule template opens.
- Enter a Name for the rule. For example: Rule_1
- Enter a Description of what the rule is for. The description helps other Studio users identify the rule when they see it in the Rules tab.
- Create a Trigger 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.- Example: You can use the STAT1 variable to require that a successful submissions of the HADS survey has been received from a participant before a site user can run the check. The following expression would return TRUE if the HADS survey has had a submission with a compliant status.
- Variable definitions:
STAT1: $survey.hads.[*].[*].[-1].Status
- Expression:
(STAT1 = "COMPLIANT")
- 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.
- In the Actions section, select the Start With date for the schedule. The available options are:
- Survey Completion Datetime: The timestamp from when the triggering survey was submitted, with the seconds removed.
- Start Event Datetime: The event datetime that belongs to the triggering survey.
- Question Answer: Data from within the triggering survey. You must reference a Datetime, Date, or Date and Time block in the survey. If you select this option, complete the following steps:
- Select a data type from the Populate With options: Datetime, Date and Time, or Date.
- Enter a reference for the data. Use variables from the Rule Tools section, or enter an @ reference. The reference must point to the same survey you referenced in the trigger.
- If you chose Datetime, you must enter a datetime reference and can optionally enter a time to override the time from the survey data.
- If you chose Date and Time, you must provide both a date reference and a time reference.
- If you chose Date, you must enter a date reference and also provide a time in 24-hour format.
- Select Save.
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.