-
Notifications
You must be signed in to change notification settings - Fork 12
Description
NOTE: DWV = @DEFAULT-WHEN-VISIBLE, DFPE = @DEFAULT-FROM-PREVIOUS-EVENT
When DFPE and DWV are used together on a hidden form field then DWV's value is what gets written into the form when it is made visible. However when DFPE and DWV are used on a visible form field then no default value is written into that field. This may be occurring because DWV does not set the default value of fields that are already visible. Or it might be a more complex issue. Here are some steps to recreate this:
- Create a select field inside an instrument that is repeated over multiple events.
- Add a DFPE tag to that select field.
- Create new record and fill out the first occurrence of that instrument for the record.
- If you go to the next occurrence of the instrument DFPE should be working properly.
- Add a DWV tag alongside the DFPE tag.
- If you refresh the next occurrence of the instrument you should see that no default value has been written to the form field that has both tags.
When DFPE's source field is set to a hidden field that uses DWV similar behavior occurs. When the DWV field in the previous event is visible DFPE works as expected. If the DWV field is not visible then DFPE stops working and no default value is set. Here are some steps to recreate this:
- Create one yes/no field and two select field inside an instrument that is repeated over multiple events.
- Add branching logic to the first select field so that it is hidden depending on what value the yes/no field is set to.
- Add a DWV tag to that first select field and a DFPE tag to the second select field. Set the source of the DFPE tag to be the first select field.
- Create a new record. Fill out the first occurrence of the instrument. Make sure the first select field is not hidden by branching logic..
- In the next occurrence of the instrument you should see DWV and DFPE working together properly.
- Go back to the first occurrence of the instrument and hide the first select field via branching logic. If you go back to the second occurrence of the instrument you should see that no default value has been written into the second select field.
Although the following is not related to DWV and DFPE's interactions with one another it may be helpful when diagnosing the problem. If DFPE is used on a field hidden by branching logic then it triggers warnings within REDCap. When you enter a new form it will ask if you would like to erase the data for the field DFPE has been applied to. If cancel is selected the branching logic breaks and the hidden field becomes visible. It also holds whatever value DFPE assigns to it. If ok is selected then the branching logic remains intact but when the field is made visible it contains no default value.