What happens if a form or question with attached rules is deleted?
When a form or question that has custom JavaScript rules is deleted, the associated rules aren't removed automatically. Instead, the rules remain in the study and appear as Invalid throughout the study.
Note:
Deleting a form or question is a Study Version change. Subjects in earlier study versions may still have that form and may still require the rule. For this reason, each rule should be evaluated to determine if it's still required and whether any logic adjustments are required based on the design change.Guidelines for handling these rules
Work closely with your study designer to confirm which rules should be retained, updated, or disabled.
- Always review rules after a form or question is deleted. Use the Rule Management page or the Rules report to identify rules that appear with an Invalid status.
- If a rule is still required for earlier study versions, update it so that it only runs where appropriate by using the
rule helper function.isStudyVersion()
- If the rule is no longer needed:
- If the form is in Testing mode and the rule is unpublished, you can delete the rule by navigating to the subject containing the form.
- If the form is in Testing mode and the rule is already published, you can disable the rule from the Rule Management page.
Quick reference for rule designers
Remember these quick guidelines whenever you have to work with copied or deleted forms.
Do | Remember |
---|---|
Review rules after a form or question is deleted or copied. | Don't forget to review the Rules report or the Rules Management page to understand all rules present in the study. |
Use the isStudyVersion() helper function if a rule should apply only to certain study versions. | Don't ignore invalid rules - they may mislead other team members. |
Disable rules that are no longer required. | Don't let invalid rules accumulate in your study without review. |
Review planned study design changes to identify impact on rules. | Don't make changes by yourself. |