Skip to content

redcap delete records

Dustin edited this page May 21, 2025 · 3 revisions

redcap-delete-records deletes the given records from a REDCap project.

Parameter Description
host Server hostname
token Authentication token (project and user specific!)
records A list of strings for the records to delete
xargs Optional parameters; see below

Optional parameters must come in pairs of 'symbol "string" or 'symbol '("list" "of" "strings").

Optional Parameter Description
'event "[evt]" Deletes just this event for the records given. Mandatory for longitudinal projects.
'instrument "[instr]" Deletes just this instrument (form) for the records given.

Examples

Example 1: Deleting two records (IDs 1 and 2) from a project.

> (define redcap:token "54CC....CC10")
> (define redcap:hostname "redcap.INSTITUTIONNAME.ca")
> (redcap-delete-records redcap:hostname redcap:token (list "1" "2"))
 #t

Example 2: Deleting just form1 on event1 for two records (IDs 1 and 2) from a project. > (define redcap:token "54CC....CC10") > (define redcap:hostname "redcap.INSTITUTIONNAME.ca") > (redcap-delete-records redcap:hostname redcap:token (list "1" "2") 'instrument "form1" 'event "event1") #t

Clone this wiki locally