Field Types
Data collection instruments in REDCap are made up of fields that collect or display different types of data. Define a field’s type when it is created.
All field types have the following components:
- A variable name made up of numbers, letters, and underscores (no spaces, dashes, or other special characters). The variable name should be short and meaningful. It will be used to refer to the field in calculations and branching logic and will correspond to the column name in data exports.
- A field label. The content in this section will be displayed on the form or survey page above, beside, or as part of the field. Use the Rich Text Editor or raw HTML to format the label. See the Survey Styling page for more guidance on customizing your instruments.
Additional field options depend on the field type.
Tip: Create a new project from a template to see examples of many field types, including open-text, multiple-choice, and checkbox fields.
A text box is a short, single-line field where users can input text or numbers. Text boxes might be unvalidated, with no restrictions on the type of values that can be entered, or validated, with restrictions on the response format.
Select a validation type to limit what values can be entered into a text box. Built-in validation formats include:
- Date or date/time (multiple formats available)
- Integer or number with a set number of decimal places
- Email address, phone number, or zipcode
- Social security number or MRN
If an entered value doesn’t conform to the field validation, respondents will get a popup alert.
You may use text boxes to collect identifying information, such as name, birth date, or medical record number. Designate a field as an identifier to allow restrictions on when data will be accessible. For example, you can limit access to identifiers via the User Rights page or exclude these fields from certain types of reports, email alerts, and data extracts.
Enable a biomedical ontology on a text box to allow real-time search of an external dictionary or code list such as ICD 10 or SNOMED CT.
A notes box is a large text box with room for a longer response. By default, notes boxes collect plain text. To allow respondents to apply text formatting or insert hyperlinks, images, and attachments, you can use the @RICHTEXT
action tag. See the Action Tag page for more information.
Drop-down fields allow respondents to select one option from a list.
Include the question or prompt in the Field Label box and each response option in the Choices box. Each choice must be listed on a separate line in the format choice-value, Choice Label
. Choice values (i.e., codes) may be numerals, letters, or alphanumeric strings. The choice labels will be displayed on your form or survey, while the values will be stored in the REDCap database.
Tip: Choice values don’t need to be listed in numeric or alphabetical order. If you need to change the display order of an existing field, you can do this without breaking the connection between existing choice values and labels.
Include the question or prompt in the Field Label box and each response option in the Choices box. Each choice must be listed on a separate line in the format choice-value, Choice Label
. Choice values may be numerals, letters, or alphanumeric strings. The choice labels will be displayed on your form or survey, while the values will be stored in the REDCap database.
Checkbox fields allow respondents to select multiple options.
Include the question or prompt in the Field Label box and each response option in the Choices box. Each choice must be listed on a separate line in the format choice-value, Choice Label
. Choice values may be numerals, letters, or alphanumeric strings.
When responses are stored in the REDCap database, they are expanded to separate variables for each choice. Variable names take the form fieldname___choicevalue
. For each expanded variable, responses will have a value of 0, meaning not checked, or 1, meaning checked. For example, the meds
field in the example above has the following choices:
1, Lexapro
2, Celexa
3, Prozac
4, Paxil
5, Zoloft
Responses are stored as variables with the following names:
meds___1
meds___2
meds___3
meds___4
meds___5
A record will have values of 0 for the variables corresponding to unchecked choices and values of 1 for the variables corresponding to checked choices.
Yes-No fields are multiple-choice (radio) fields with the built-in options:
1, Yes
0, No
True-False fields are multiple-choice (radio) fields with the built-in options:
1, True
0, False
A matrix allows compact display of multiple radio or checkbox fields with the same response choices. Create a matrix by clicking Add Matrix of Fields
in the Online Designer.
Add introductory text to the Matrix Header Text box. Then add each variable name and field label in the Matrix Rows section.
Define the choice values and labels in the Matrix Column Choices box, as you would with a standalone multiple-choice or checkbox field. Specify whether respondents can select one answer or multiple answers per row. Finally, give the matrix a group name.
On the form or survey, the matrix will be displayed as a grid with fields in rows and choice options in columns.
Calculated fields return a numeric value in real time based other fields’ values or contextual information. For example, you might create a calculated field to return a patient’s age based on their date of birth and today’s date. See the Special Functions page within REDCap for more about how to calculate values.
This type of field allows respondents to sign with a mouse or their finger. The signature is captured as an image file.
Use a file upload field to allow respondents to attach files such as PDFs, spreadsheets, or images. A file upload field can capture a single file up to 50 MB in size. Include multiple fields if users will need to upload more than one file.
Slider fields allow respondents to provide a numeric response by moving a slider icon. Define the following components of the scale:
- Minimum and maximum numeric values. These values will be stored in the database.
- Labels for the lowest, middle, and highest values.
Descriptive fields don’t collect data; they comprise only a field label that allows you to display text, images, links, and attachments. Use descriptive fields to share informational text and embed or pipe values from other locations. See the Survey Styling page for more guidance on embedding fields and customizing descriptive text.
It’s important to remember that descriptive text fields don’t contain or capture values. The displayed text won’t be included in any data exports or imports, even if the field label pipes record-specific data from one part of your project to another. To transfer data from one field or instrument to another, consider the following options:
- Use a calculated field with piping to capture a numeric value
- Use a text field with a
@CALCTEXT
action tag and piping to capture a text value - Use a
@DEFAULT
or@SETVALUE
action tag with a text, notes, multiple-choice, or checkbox field to set the field’s value when the page loads
See the Action Tag page for more information about action tags.
“Begin New Section” fields don’t collect data or have variable names. Instead, they allow you to organize instruments into sections with header text. Branching logic applies to section headers: if every field in a section is hidden, the header will also be hidden.
If your instrument is enabled as a survey with pagination, each section will display on a separate page.
This is a special type of field that allows lookup of values stored in the REDCap database. Only REDCap administrators can create and edit SQL fields. For more information about SQL fields, please contact the REDCap administrator.