GetValue
- GetValue(Integer)
- GetValue(Date)
- GetValue(String)
- GetValue(Float)
Characteristic | Description |
---|---|
Icon |
![]() |
Availability |
All items. |
Return type and description |
If the Empty property of the item is True—Returns the replacement value (a parameter of the method). If the Empty property of the item is False—Returns the value of the item. |
Syntax |
(If rule is created on a study design)
Note: If the item is a child of a repeating study object, method information is included in the rule expression to indicate the item instance to which you are referring. |
Parameters |
|
Example |
If:
|
Purpose |
This method is useful for replacing a null value with a value that is usable for calculations, or for causing a rule to run even if a value has not been entered. For example, a BMI calculation typically does not run until the InForm user enters both a Height and Weight value for a subject. However, you can use this method to store a value of 0 in the BMI field if either Height or Weight is missing. Below is a typical rule expression for calculating BMI:
This rule expression does not calculate the BMI until both values are present. Below is the same expression, except it uses GetValue
This expression calculates BMI upon submission of the form, regardless of whether the values for Height and Weight were entered. In both cases, the expression checks whether Height is 0. If Height is 0, a divide-by-zero error occurs. |
Parent topic: Methods for repeating study objects