-
Notifications
You must be signed in to change notification settings - Fork 10
Events Import
asaweero edited this page Aug 22, 2017
·
4 revisions
Imports events into a project or change the attributes of currently existing events. Returns the number of events imported.
-
override
: If set to 1, all existing events are erased and any new events in data will be imported. By default, this is set to 0, which only allows adding events and renaming existing ones. -
data
: The events you wish to import/update. Events must contain two attributes.event_name
andarm_num
. If you're updating an event that is already in the project, you must also provide theunique_event_name
attribute. If the project uses the scheduling module, then you can optionally provide theday_offset
,offset_min
, andoffset_max
attributes. Ifday_offset
is not provided, then the events will be auto-numbered in the order in which they are provided in the API request.
- Return the Number of Events imported
var params = {
data: [
{
event_name: "import_test_event",
arm_num: "1",
unique_event_name: "import_test_event_arm_1"
}
],
override: 0
};
redcap.events.import (params, function (error, res) {
// error containts oprtional errors
if (err) {
// handle error
}
else {
// res is return value
console.log (res);
}
});