Using External Fields to Reference Within Conditional Actions (cross-form logic)
External variables allow users to define fields outside the current form along with the interval that the field should be evaluated in, and for use with a conditional action in the current form. These can only be done using a Web Browser.
Hide a form based on data entered in another form
Compare a date in one form against a date in another form
External fields are only available at the study level where forms are collected at defined intervals. In other words, host-level forms will not enforce external variables.
Define External Fields
To access the external variables table:
- Navigate to the Study menu
- Select External Variables
This will open the table of existing variables and a form to define new ones as shown below.
The name designated for the external field can be anything. However, the name should describe the form and the field itself. This makes it easy to pick out the fields when there are lots of defined external fields.
Currently, the only selection available in the dropdown list is External Fields. However, the ability to add other types of fields in the future is possible. For now, simply select External Field.
Select the form where the external field resides from the list presented.
Once a Form has been selected, all the fields defined in that form will populate the field dropdown. Select the field to use externally.
The interval tells the system where exactly to retrieve the data for the external field when evaluating the conditional action expression. Here is a list of the Interval options to identify the data needed from a form:
- Visit Intervals - All visits will be listed to choose from. For example, if you need to reference the Physical exam date at the 6 month follow up visit.
- Unscheduled - The latest record ID for the defined form wherever it is not collected in a visit schedule. This is most commonly used for the Registration form where there is only one record being collected for the form.
- Previous Interval - The closest visit date record before the current visit interval where the expression is being evaluated.
- Previous Entered Form - The latest Record ID for the defined form wherever it's collected - both in scheduled visits or unscheduled visits. If the expression is evaluated in a CA on the same form, it will get the latest record ID prior to the current record. An example would be to check for a continual increasing value over time - such as a Subject's age, or an adverse event sequence number.
- Same Visit - Gets the value from the defined form only if the CA is being evaluated in a scheduled visit where that form also exists.
Using External Fields
Select from the list of available external variables created in the previous steps above.
When comparing an external variable to another field, the system will limit to comparing fields only of similar types. For example, if the external is a date field, it can be compared to dates and numbers, but can't be checked to make sure its not equal to a choice field.
Two-way edit checks: If a form, "Form A", containing an external variable is saved, and another form "Form B" contains an edit check referring back to Form A, then a query has potential to open on Form B - even if the user is not saving Form B. This is a very helpful function to catch data errors when any of the dependency values are changed.
Deleting External Variables
Be cautious when deleting variables that may be in use on conditional actions. If the study status is Live and the variable is being used, the system will prevent deleting.
On the flip-side, the system will allow for deleting Fields on a form. If that field was used as an external variable, the external variable will get deleted automatically when the field is deleted. If that external variable is being used in a previous study version, it will no longer work.
Export External Variables
The list can be exported, along with all dependencies for record keeping purposes, along with the conditional actions data dictionary for a complete picture of how cross-form logic has been designed.