Action Tags
Action tags are special features that begin with the '@' sign that can be placed inside a field's Field
Annotation. Each action tag has a corresponding action that is performed for the field when displayed
on data entry forms and survey pages.
A full list of the action tags that can be used in REDCap:
Performs a date calculation by adding or subtracting a specified amount of time
from a specified date or datetime field and then provides the result as a date or
datetime value - e.g., @CALCDATE([visit_date], 7, 'd'). The first parameter inside
the @CALCDATE() function should be a text field with date, datetime, or
datetime_seconds validation, in which you may specify (if needed) the event and
repeating instance - e.g., @CALCDATE([baseline_event][visit_date], 7, 'd'). The
second parameter represents the offset number amount that should be added
or subtracted. It can be a decimal number or integer. Tip: To subtract (i.e., go
backwards in time), use a negative number. The third parameter represents the
units of the offset amount, which will be represented by the following options:
'y' (years, 1 year = 365.2425 days), 'M' (months, 1 month = 30.44 days), 'd'
(days), 'h' (hours), 'm' (minutes), 's' (seconds). The unit option must be wrapped
in quotes or apostrophes. NOTE: Both the source field and the result field must
be a text field with date, datetime, or datetime_seconds validation. It is
important to realize that a field with @CALCDATE will not be editable on the
survey page or data entry form, and the field will function almost exactly like a
normal calculated field, in which its value may get updated via a data import,
when running Data Quality rule H, or in real-time during normal data entry on a
Evaluates logic that is provided inside a @CALCTEXT() function and outputs the
result as text, typically performed with an if(x,y,z) function - e.g.,
@CALCTEXT(if([gender]='1', 'male', 'female')). NOTE: It is important to realize
that a field with @CALCTEXT will not be editable on the survey page or data
entry form, and the field will function almost exactly like a normal calculated
field, in which its value may get updated via a data import, when running Data
Quality rule H, or in real-time during normal data entry on a form or survey. If
desired, it is possible to return the value as a number - e.g., @CALCTEXT(if([age]
>= 18, 'adult', 5*[other_field])). Also, while it is possible to use static text (in
quotes), field variables, or Smart Variables as the return values of the IF function
- e.g., @CALCTEXT(if([age] >= 18, [dob], [event-label]) - it is NOT possible to pipe
field variables or Smart Variables inside quotes for the return values.
Limits the number of characters in a field