Answer
Note: These instructions assume that you have already created all of your REDCap forms, and have data that you want to import from Excel. The biggest hurdle is making sure that all of the data is in a format importable into REDCap (see 4. below). Using the Codebook will help a great deal in verifying which fields need which format when setting up your data file for the import.
- While in your project, click “Data Import Tool” in the left-hand navigation bar (under 'Applications').
- Click on the “Download your Data Import Template” link, which is in the first paragraph of instructions, and download the template to a secure location. (Your BILH H:\ drive, OneDrive, or encrypted hard drive of a BILH computer.)
- Open up the template in Excel and copy/paste from your source file into the template. Most fields will be a single column, with the header being the variable name.
As you copy and paste, you must also verify (or change) the data to be in a REDCap import-able format.
- Identity columns: All templates will include the record_id column as the first column. This column must always be filled in with a value even if you want REDCap to renumber the records on import. Depending on your project setup, you may also have 2-3 additional identity columns such as redcap_event_name or instance_number. Always keep these columns; they are required for import.
- Except for the identity columns, all other columns may be deleted if you are not planning to import data into them.
- Every form has a REDCap added field at the end, called "formname_complete". This sets the form status when viewed in the Record Status Dashboard. If you want to mark the form as "Complete", (green), then be sure to keep the this field, and fill it in as "2" for a value for each record. Otherwise, it will import as "Incomplete" (red). You will able to see the options for this field in the Codebook.
- Text fields: All text columns can generally be left alone- they will import fine.
- Dates: Dates should be in the format of YYYY-MM-DD or MM/DD/YYYY.
- Radio buttons, drop-downs and checkboxes: Any multiple choice (radio buttons or dropdown list) and checkboxes must be changed into raw data format. For instance, if the question is a radio button with options as below, your column for the import needs to be made up of raw value (“1”, “2” or “3”), not the label, (the drug name).
- Identity columns: All templates will include the record_id column as the first column. This column must always be filled in with a value even if you want REDCap to renumber the records on import. Depending on your project setup, you may also have 2-3 additional identity columns such as redcap_event_name or instance_number. Always keep these columns; they are required for import.
- Once your template has all the data saved, return to the Data Import Tool page. In the green box at the bottom, select your import settings and specify the import file. Import settings include:
- Choose an import option: Choose "Import in real time" for small imports, and the "Import as background process" for large imports. If this is your first time importing, it is best to start with a small test file first.
- Select your CSV data file: Browse to the data file- generally in csv format.
- Display the data comparison table?: Choose "Yes" if importing in real-time. The data comparison table gives you a chance to review what will be imported and how it impacts existing data. At that point, you can choose to cancel out of the import, or proceed. This adds an extra step to the import process, but it is well worth it. Not an option for background imports.
- Auto-number/overwrite record IDs?: Only use record-auto-numbering for importing new records. If you want to update existing records, be sure to select "No, use the record name provided"- and be sure the record name specified in the import file is accurate!
- Overwrite data with blank values? In most cases, you will want to "No, ignore blank values in file". Only a few updates will require overwriting existing entries with blanks.
Tips:
- If updating or adding to a Production project, be sure to back up your existing data before you begin. We highly recommend that you start with only a few records/columns, import in real time, and use the data comparison table.
- Also in Production: You can also use a custom report to effectively build your own data import file if you just need to update a few fields in a large project. This is especially helpful if you need to convert from an "old" field to a "new" field- you can build a report that just has the record id, the old field and the new field. Download the export, fill in the new field as needed, and then import it back in.
- CSV files do not save formats for dates. If you are working on an import with dates, or a big import, it is sometimes handy to save a master file in Excel format- xlsx- so you don't have to keep resetting the date back into REDCap compatible format. When you are ready to export, you can export a copy of the Excel worksheet as a .CSV. (File -> Export -> Change File Type-> CSV (Comma delimited) (*.csv). Then click the 'Save As' button.)
- If working in a Development project, there is an "Erase all data" button on the "Other Functionality" page, if you want to delete everything and start again. This button does not appear when a project is in Production mode.
- In any mode, particularly if doing a large import, you may not see the records that you just imported. If that happens, click 'Clear all record & page caches' on the "Other Functionality" page.
See also:
Other