You can't import survey data from the Castor EDC/CDMS user interface. You can import it through the Castor API or enter it manually on a participant's behalf.
You can import data into study forms and repeating data through the user interface:
Enter survey data manually
Use this option if you collected survey responses another way, for example on paper, and want to enter them in Castor yourself.
-
Make sure a survey invitation exists.
If the participant doesn't have an invitation for the survey yet, create one (user a dummy email address if the participant doesn't have one). To avoid sending an email to the participant, set the sending date to Decide later: Send individual surveys in CDMS -
Go to the Surveys overview tab.
Open the Surveys tab in your study, or the surveys of that participant, and find their invitation row. -
Open the survey for data entry.
Click the three dots (…) at the right of the invitation row, then choose Open survey in new window.Note: Don't choose View survey (uneditable). It opens the survey in read-only mode.
-
Enter and submit the responses.
Fill in the responses, then click Finish (or Submit) to complete the survey.
Good to know: The audit trail logs data you enter this way under your own user account, not the participant's. This keeps it clear who entered the data.
Import survey data via the API
Survey data always belongs to a survey package invitation (a survey package instance) for a specific participant. So an API import has two parts: make sure an invitation exists, then write the data points to the surveys in that invitation.
Before you start
- API credentials: Go to Account settings → Personal access tokens (or API) and generate a Client ID and Client Secret. The API uses OAuth2 (client credentials) to authenticate.
- Permissions: Your user needs the correct rights at the participant's site, including View/View surveys permissions. The audit trail records every value written through the API under your user account.
- IDs you will need: the Study ID, the participant IDs, the survey package ID, and the field IDs (or variable names) of the survey questions. You can get these from the API or from the Form Builder and Study settings.
Steps
-
Authenticate. Request an access token with your Client ID and Secret:
POST /oauth/token -
Create a survey package invitation for each participant who doesn't have one yet:
POST /api/study/{study_id}/surveypackageinstance
If you don't want the participant to get an email, leave out the email address or the sending date. -
Find the survey instance ID. Retrieve the invitation and note the IDs of the survey instances inside it:
GET /api/study/{study_id}/surveypackageinstance/{survey_package_instance_id} -
Write the survey data points:
POST /api/study/{study_id}/participant/{participant_id}/data-points/survey-instance/{survey_instance_id}
Send a list offield_idandfield_valuepairs in the request body.
- For full request and response details, see the Castor API documentation.