
Last chance! 50% off unlimited learning
Sale ends in
These methods enable the user to get the next record name (when auto numbering is enabled) or rename and existing record.
exportNextRecordName(rcon, ...)renameRecord(rcon, record_name, new_record_name, arm = NULL, ...)
# S3 method for redcapApiConnection
exportNextRecordName(
rcon,
...,
error_handling = getOption("redcap_error_handling"),
config = list(),
api_param = list()
)
# S3 method for redcapApiConnection
renameRecord(
rcon,
record_name,
new_record_name,
arm = NULL,
...,
error_handling = getOption("redcap_error_handling"),
config = list(),
api_param = list()
)
exportNextRecordName
returns an integerish value. The value is
determined by looking up the highest record ID number in the
project and incrementing it by 1.
renameRecord
invisibly returns a logical value that indicates if the
operation was successful. Otherwise, an error is thrown.
A redcapConnection
object.
character(1)
or integerish(1)
.
The name of an existing record in the project.
character(1)
or integerish(1)
.
The new name to give to the record.
character(1)
or NULL
, an optional arm number.
If NULL
, then all records with same name across all arms on
which it exists (if longitudinal with multiple arms) will be
renamed to new record name, otherwise it will rename the record
only in the specified arm.
Arguments to pass to other methods
character(1)
. One of c("error", "null")
.
An option for how to handle errors returned by the API.
see redcapError()
.
A named list
. Additional configuration parameters to pass to
httr::POST()
. These are appended to any parameters in
rcon$config
.
A named list
. Additional API parameters to pass into the
body of the API call. This provides users to execute calls with options
that may not otherwise be supported by redcapAPI
.
exportNextRecordName()
: Get the ID number for the next record to be created.
renameRecord()
: Rename an existing record.
exportRecords()
,
exportReports()
,
importRecords()
,
deleteRecords()
,
exportRecordsTyped()
,
exportReportsTyped()
if (FALSE) {
unlockREDCap(connections = c(rcon = "project_alias"),
url = "your_redcap_url",
keyring = "API_KEYs",
envir = globalenv())
# Get the next record name
exportNextRecordName(rcon)
# Rename an existing record
renameRecord(rcon,
record_name = "1",
new_record_name = "42")
}
Run the code above in your browser using DataLab