Can I hide a field that was previously used, without deleting already collected data?
Hiding a field which already contains data can be done by using dependencies.
Before you start:
- Make sure that the study setting "clear inapplicable field child" is disabled (checkbox is unchecked) in order to prevent data loss. This can be done in Settings > Study > Other > "Clear inapplicable child fields". Please note that this setting is only applicable to study and report forms, not to surveys. For surveys, once the field is hidden by using a dependency, the data will be deleted if the dependency is changed and field becomes visible again. If you delete the dependency, the data in a dependent field in a survey will not be deleted.
- As a precaution, always do a data backup before implementing any changes.
- Once the field is hidden, the data will still be exported. If you would like to disable the export of data for this field, click on the pencil icon next to to this field. In the Edit dialog window navigate to Advanced > set Exclude field in data exports to Yes
After taking all the above into consideration, you can proceed to hide the field as such:
1. Create a calculation field, and set the calculation template as "1". You can also choose to hide this field as highlighted in the screenshot to make sure it doesn't appear in the actual forms.
2. Create a dependency by navigating to the Edit tab of the field you wish to hide, in this case ‘Heart rate’ field. Make it dependent on the above calculation, setting the dependency as "is equal to 0". Since the calculation will always output 1, and the dependency is set to show the question only when the calculation field outputs 0, this condition will not be met. The field will always be hidden.
When making changes to your study after it has been live, please consider possible implications for signatures and verifications, read more information here: Can I still change the forms when my study is live in CDMS?