recordsManagementMethods function

Export Next Record Name or Rename a Record

Export Next Record Name or Rename a Record

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 class 'redcapApiConnection' exportNextRecordName(rcon, ...) ## S3 method for class 'redcapApiConnection' renameRecord(rcon, record_name, new_record_name, arm = NULL, ...)

Arguments

  • rcon: A redcapConnection object.
  • record_name: character(1) or integerish(1). The name of an existing record in the project.
  • new_record_name: character(1) or integerish(1). The new name to give to the record.
  • arm: 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

Returns

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.

Functions

  • exportNextRecordName(): Get the ID number for the next record to be created.
  • renameRecord(): Rename an existing record.

Examples

## Not run: 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") ## End(Not run)

See Also

exportRecords(),

exportReports(),

importRecords(),

deleteRecords(),

exportRecordsTyped(),

exportReportsTyped()

  • Maintainer: Shawn Garbett
  • License: GPL-2
  • Last published: 2024-10-17

Downloads (last 30 days):