Universal Field Validator

@UVREQUIRED

@UVREQUIRED is a REDCap action tag that makes a field required only while a condition is true, and can actually block the save instead of only warning like REDCap's native required flag.

REDCap's own required flag is unconditional and only warns. @UVREQUIRED adds the two things it lacks: a condition and a real block.

Syntax

@UVREQUIRED                                   always required

@UVREQUIRED="[consent]='1'"                   required only while consented

@UVREQUIRED={"when":"[consent]='1'",
             "message":"Phone needed for consented participants",
             "blockSave":"hard"}

Behaviour

Field types

Text, Notes, dropdown, radio, yes/no, true/false and slider.

Not calc fields. The person entering data cannot fill a calc, so requiring one would trap them. The same reasoning covers read-only fields: a read-only field shows the notice but never blocks the save.

Audit

The server audit logs a blank-while-required save as type: required, reason: required-blank. A blank carries nothing identifying, so this entry is safe to keep in every privacy mode.