Below are some commonly used field rules and rule combinations.
In this article
Skip if/unless rules
Sometimes you may want to hide a particular field based on how the previous question/s have been answered. You can do this by using 'skip if/unless' rules.
For example, if you have the following questions,
Q1: Is the patient on antidepressants? (Yes/No field)
Q2: Please provide antidepressant name (text field)
and you want Q2 to only be available if Q1 has been answered as Yes, then you can add the following rule: ‘Skip unless Q1 has the value Yes’. This way, Q2 will be skipped if Q1 has been answered as No or has not been answered at all.
You can also add the rule ‘Required if Q1 has the value Yes’ to make the field required (i.e. the form cannot be saved unless the field has been answered or a reason has been provided).
You may want a field to be shown based on how several previous questions have been answered.
For example, you may want Q4 to be shown only when Q1, Q2, and Q3 have ALL been answered as No. In this case, you need to add the following rules.
‘Skip unless’ rules 1-3 determine that Q4 only shows when all three previous questions have been answered as No. The ‘skip unless’ rules on the same field are evaluated independently, so the field only becomes available (not skipped) if all three 'unless' rules are met.
‘Required if’ rules 3-6 define that Q4 is required when all three questions are No.
The example below shows a more complex case, in which Q2 is conditional on Q1 being Yes, Q3 is conditional on Q2 being Yes, and Q4 is shown if ANY of Q1-Q3 are No.
Here, rules 1 and 2 for Q2 and Q3 make them available and required only when the previous question is Yes. ‘Required if’ rules 1-3 for Q4 make it required when Q1-Q3 are No, and ‘skip if’ rule 4 defines that Q4 will be hidden if Q3 is Yes.
Sometimes you may need to check that that certain date falls within a specified date range. For example, you want to check that the date of a certain visit is 3 weeks after the date of consent plus/minus 5 days.
3 weeks = 21 days
21 – 5 = 16 days
21 + 5 = 26 days
Therefore, your rules need to be as follows:
Date must be on or after date of consent + 16 days
Date must be on or before date of consent + 26 days
Age 18 or older
You may want to check that a participant's DOB corresponds to an age of 18 years or older at randomisation (or on any other date recorded in your CRF).
If age must be 18 or older, you need to add the following rule to the DOB field:
DOB must be on or before randomisation date – 18 years
If age must be 18 or older on a certain date, for example, the date of informed consent, you need to add the following rule to the DOB field:
DOB must be on or after date of consent – 18 years
You may want to check that a participant’s DOB corresponds to a certain age range at randomisation (or on any date recorded on the CRF).
For example, if age must be between 18 and 60 years at randomisation, you need to add the following rules to the DOB field:
DOB must be on or before date when randomisation form is added – 18 years
BOB must be on or after date when randomisation form is added – 60 years
Date must be the same as another date
You may want to check that a certain date is the same as another date.
For example, if the date the QOL questionnaire completed must be the same as the date of examination, you need to add the following rules to the date QOL questionnaire completed:
Date QOL questionnaire completed must be on or before date of examination
Date QOL questionnaire completed must be on or after date of examination