/
Avoid Erase Field Popup/Error and retain the value that already existed in the hidden field

Avoid Erase Field Popup/Error and retain the value that already existed in the hidden field

Usually, when there is a value (either imported or forcefully saved) in a field that is either supposed to be hidden or appear/branch-out only when a specific field (usually antecedent) in the form is selected, the system throws an error while you open the record.
The error looks like the one below:
In order to avoid this popup and at the same time avoid any loss of data, we can add a piece of extra element(see the highlighted code below) in the branching logic. 
For example,
In the above example, in the line 3, usually in the absence of the highlighted element, the field [show1] opens up only when [select1]='1'. 
However, by adding OR [show1]<>" "(No spaces between quotes, or you may use single quotes without spaces for numeric field types), the field will retain any value that it contains and avoid any warnings/popups.
Similarly, we can add OR [anyvariablename]<>" "No spaces between quotes, or you may use single quotes without spaces for numeric field types) wherever possible to avoid such popups. Especially in case of long forms with multiple branching logics throwing such errors to erase values in the hidden fields, identifying those fields and adding this extension of code would be really helpful.
This should be fairly easy to understand, however, for any assistance regarding to implementing this solution, please contact Sairam Sutari at redcap_helpdesk@wustl.edu

-- Sairam Sutari

Related content

Create a Re-Enter Email Address for REDCap Survey
Create a Re-Enter Email Address for REDCap Survey
More like this
Check for Specific Email Domain on REDCap Survey
Check for Specific Email Domain on REDCap Survey
More like this
REDCap - Field Embedding
REDCap - Field Embedding
More like this