Import study data in CDMS
Here you will learn how to import data, either per participant or for multiple participants at a time.
If you are looking to import repeating data, check the article: Import repeating data.
Before you start
Here are some things to check before you begin this process:
- The variables must already exist in your study and must have assigned variable names. It is only possible to import data into fields where variable names are defined. Data will not be imported into fields which contain only labels and where variable name is not defined.
- Importing data can only occur into participants and fields that exist in your study and have variable names assigned. The variable names in your import file must be the same as defined in your study.
- Your import file cannot be empty, at least one valid data point (value) is required. Make sure to include a variable and data value for participant IDs you wish to import.
- The participants do not have to be created in Castor, as you can create them on the fly during import.
- You must have Edit rights enabled for the site where the participant(s) belongs.
- If you are importing encrypted data, you also need Encrypt rights.
- Check the encoding of your importing file: Castor supports UTF-8 encoded files. If your CSV is encoded using ISO-8859-1, you will need to change any data with the character "¨" (e.g. ë) and remove the character. Otherwise, an error will be shown when trying to import the file.
- For unencrypted data, the limit for a single import is 25,000 data points. For encrypted data, this is much lower.
- Date fields must be formatted as DD-MM-YYYY. In cases where date values without leading zeros are imported, the date format will be adjusted to 0D-0M-YYYY and the following warning message is shown in the preview dialog: ‘Imported date format will be <0D-0M-YYYY>. It is also possible to include partial dates in your import file by using either of these formats: UK-MM-YYYY; UK-UK-YYYY; 00-MM-YYYY; 00-00-YYYY. Any invalid format will not be imported.
Note: Partial date formats are only available upon request. If you would like to use this option, kindly reach out to firstname.lastname@example.org to submit your request.
- For importing Participant status, the Participant status name must exist in the study. If the imported value for Participant status is empty, this is considered an intentional removal of the status for the affected participant(s) and will be therefore updated to ‘not set’ (the default value for all participants). A warning in the import preview will show ‘Participant Status will be unset’.
- Please note that it is not possible to import survey data via CSV, the survey data can only be imported via API.
- Please note that it is not possible to import queries, comments, signatures or data verifications.
Importing data will overwrite existing data, please make sure you are only importing data for empty fields, or data you wish to overwrite.
Prepare your data for import
The easiest way to prepare the data is to first create an export of any participant (this can also be a test participant). This way you will have all of the columns properly formatted, as the import file will look similarly to the export file. You can then simply add your data in that file.
Format your data according the following guidelines:
- Prepare your data horizontally, with the participant Id(s) in one of the first five columns (A-E).
- If you want to create participants that do not yet exist in Castor, you will also need to specify the site abbreviation (as specified in the study Settings) in order to map the participant to the correct site.
- The first row should always contain the variable names. These should match the Castor variable names exactly. The variable names are case-sensitive.
- Ensure that your data is formatted correctly depending on the field types, as explained in the article Formats for data import
- Save your data as a .csv file.
Proceed with import in Castor
To import data:
- Click on the 'Actions' button and choose 'Import' option from the dropdown menu
- Click on the context menu (three dots) next to a participant and choose "Import".
In the pop-up dialog, you need to specify the following elements:
- File: Choose the file (newer browsers will always display c:\fakepath as a security measure).
- Import type: Choose if the import type is study import or repeating data import. Repeating Data data import is explained here.
- Participant id column: Choose the column from your csv-file that contains the participant ID's.
- Create participants that do not exist: Check the box if you want to create new participants with the imported data and fill existing participants, instead of only filling the existing participants.
- Site abbreviation column: Choose the column from your csv-file that contains the abbreviation of the site, only required when creating new participants on the fly.
- Import email addresses: Choose if you want to import email addresses
- Import participant status: Choose if you want to import participant status
- Provide password: to import email addresses, please provide password
- Email address column: specify column in your csv-file where the email addresses are stored
- Click Import
The data importer will first show a preview of all data that will be imported. This way it is possible to see the results before you accept the import and allows for cancelling the import if needed. You will also see any data validations that will be triggered with the data you are importing.
If the import preview indicates no errors, you can simply click on Accept to continue.
If there are errors shown, you might need to correct the data before proceeding.
Note: When a study form is locked, warning message will be displayed in the import preview for to inform that data will be imported in that form.