08 Aug Modify Individual Survey Fields with Action Tags
Ever wish you could make a certain field read-only? Well, action tags will allow you to do that and more.
Action tags are a relatively new addition to REDCap and can be applied to any variable. Each action tag has a corresponding action that is performed when displayed on data entry forms and surveypages. For example, the action tag @READONLY will make the field read-only so that its value cannot be changed. Action tags can also automatically capture a date or time or even pre-populate the field with a default value.
You can apply multiple action tags to the same variable. For instance, you can make a field automatically capture today’s date and make that same field read-only so that your survey participants can’t change that value.
To add an action tag, follow these steps:
- In the online designer, navigate to the variable you want to add the action tag to.
- Locate the red “Learn about Action Tags” link next to the field annotation box.
- In the next dialog box, find the action tag you want to apply to that variable. Click Add.
- Scroll to the bottom of the action tag dialog box and click Close. Then click Save in the “Edit Field” dialog box.
To delete an action tag from a variable, simply highlight the action tag in field annotation field and delete it with backspace or the delete button.
Below is a list of REDCap action tags along with some that have corresponding tips of the month describing them in more detail with their variations. Remember new action tags are being added to REDCap all the time so make sure to check for new options frequently.
Action tags available
In the REDCap Mobile App, it sets a field’s value to the app username of the current mobile app user – i.e., their username in the mobile app, which is not necessarily the same as their REDCap server username that can be captured using @USERNAME. NOTE: For use only in the REDCap Mobile App.
Allows the REDCap Mobile App to capture the value of a barcode or QR code by scanning it with the device’s camera. NOTE: For use only in the REDCap Mobile App.
Sets the maximum number of characters that can be entered into a text field or Notes field, and also displays the number of charactrs remaining.
Sets a field’s initial value. This allows a field to have a specified default value when viewing the field on a survey or data entry form that has not yet had any data saved for it (i.e., when the form status icon is gray or when a survey page has not had any data entered yet).
@HIDDEN Learn more ›
Hides the field on the survey page, the data entry form, and in the REDCap mobile app. Field will stay hidden even if branching logic attempts to make it visible. Also available with variations @HIDDEN-FORM, @HIDDEN-SURVEY, and @ HIDDEN-APP
Hides the ‘Now’ or ‘Today’ button that is typically displayed to the right of date, time, and date/time fields.
@HIDECHOICE Learn more ›
Hides one or more choices of a multiple choice field. This action tag is useful if you wish to retire a particular choice after utilizing it for a while in data collection, thus allowing you to hide the choice from that point afterward without orphaning any of the choice’s data, which would happen if you simply deleted the choice.
Converts a radio, checkbox, or text field into a clickable image. For example, to display a male body with clickable body parts, you may use @IMAGEMAP=PAINMAP_MALE. For a full list of available image maps and details about options, please reference the full documentation.
@LATITUDE and @ LONGITUDE
Allows a Text field field to capture the latitude or longitude of the user, in which the user will be prompted on the webpage to allow or deny this. Once the value is captured, it will not be changed when visiting the page at a later time. The field will be disabled and will not allow users to edit the value, but it will allow them to remove the value altogether. NOTE: While the GPS value will be very accurate when captured on a mobile device, it will not be nearly as accurate when using a browser on laptops and desktop computers.
Allows a checkbox field to have a maximum number of checkboxes that can be checked. If other checkbox options are clicked after the maximum has been reached, those choices will not be able to be checked.
Causes one or more specified choices to be disabled (i.e., displayed but not usable) for a checkbox, radio button, or drop-down field after a specified amount of records have been saved with that choice.
@NONEOFTHEABOVE Learn more ›
Allows for the designation of a checkbox choice to be a ‘none of the above’ option, thus ensuring that no other choices are checked if that one choice is selected. This means that if that particular option is selected, it will alert the user that all other checked-off choices will be unchecked. And if the ‘none of the above’ option is already checked when the user checks off another choice, it will automatically uncheck the ‘none of the above’ option.
@NOW and @TODAY Learn more ›
Automatically provides the user’s current time or date as the value of a Text when the page is loaded. Once the value is captured, it will not be changed when visiting the page at a later time. If the field has validation, the value will conform to the date/time format of the field. The field will be disabled and will not allow users to edit the value. NOTE: The time will be the user’s local time, which is derived from their device/computer.
Masks the value of a Text field so that the true value is not visible on the webpage after it has been entered (like password fields on login pages)\
Is used to specify a short hint that describes the expected value of a Text field or Notes field (e.g. a sample value or a short description of the expected format). The placeholder is displayed inside the field before a value is entered.
Randomizes the order of multiple choice field options as displayed on survey pages and data entry forms, in which their order will always be different each time the page is loaded by any given user.
Makes the field read-only (i.e., disabled) on the survey page, the data entry form, and in the REDCap mobile app so that its value cannot be changed. Also available with variations @READONLY-FORM, @READONLY-SURVEY, and @READONLY-APP.
Can be used only for File Upload and Signature fields. If the project is initialized in the REDCap Mobile App, this will cause any image files uploaded to a record to be sent to the app so that they are viewable in the app when editing the record.
Sets a field’s value to the username of the current REDCap user. If this is used on a survey, the value will be ‘[survey respondent]’. Once the value is captured, it will not be changed when visiting the page at a later time.
Sets the maximum number of words that can be entered into a Text field or Notes field, and also displays the number of words remaining.