External Variables and Constants

Share or Open in Web

External Fields are used to reference within conditional actions (cross-form logic).

External fields are only available at the study level. In other words, host-level forms will not enforce external variables. They allow users to define fields that exist 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.

Common examples:

  • Hide a form based on data entered in another form

  • Compare a date in one form against a date in another form

Define External Fields

Access the external variables table under the Study menu:

This will open the table of existing variables and a form to define new ones:

Name

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.

Type

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.

Form

Select the form where the external field resides from the list presented.

Field

Once a Form has been selected, all the fields defined in that form will populate the field dropdown. Select the field to use externally.

Interval

The interval tells the system where to retrieve the data for the external field when evaluating the conditional action expression. It is comprised of all existing visit intervals, the most recent visit, or any unscheduled interval. 

The most recent visit interval is the closest visit date record before the current visit interval where the expression is being evaluated.

Any visit interval can also be used generically. For example, you may wish to see if a current medication has been prescribed to the subject. This will check all intervals. Any interval with data that matches will cause the condition to be true. (If a field is selected from the Enrollment Form the Interval will need to be Unscheduled).

Using External Fields

The Conditional Action builder is smart enough to know exactly what to compare an external field with. 

For example:  In the figure below:

  1. the external gender field can only be compared to the available field choices defined for gender. 

  2. External fields can be used on either side of the comparison:

Notice that External Fields have their own heading in the comparison dropdown. This makes selecting them very easy. Then, when making the comparison as shown in the following figure, notice the Conditional Action Builder gives the correct comparison choices. Also notice that an external field like any other criteria can be compared to choices, numbers, constants, and other external fields and local fields of a similar type.

If you know how to use conditional actions then you already know how to use External Fields. They must be defined first.  Then they can be used like any other field in the current form.

One limitation of External Fields is they cannot be used when creating computed fields.

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.

Constants

Constants are nearly identical to External Fields. They are used in exactly the same way. However, they are not user-defined. Instead, the system defines constants for Users and automatically populates the criteria dropdown. Currently, Constants can be used in all conditional actions, including computed fields. The following constants are available:

CurrentDate

Use the current date in a comparison or calculation.

CurrentInterval

Compare the current interval. One of its many uses is the ability to use the same form over multiple intervals despite that form having subtle differences for each interval. By comparing the current interval you can hide the fields that are irrelevant to the current interval.

Randomization Name

If randomization is defined on the study, the name of each randomization schedule will display to select from, for use within conditions. For example, Hide a field based on the allocation value of the randomized subject.

TxDate

This is the date the treatment started. It is usually baseline; however, that is determined by the study designer. It too is entered when the subject is enrolled.

SubProfileID

Use the subject’s profile ID to define a condition

Site

Use the site ID (system ID found in the Site Manager) to use in a condition

Related articles