Skip to contents

Allows for editing a specific field in a REDCap project while simultaneously viewing the corresponding records and fields from other forms. Supports viewing and updating records individually, with flexible field selection.

Usage

edit_REDCap_while_viewing(
  project,
  optional_form,
  records,
  field_name_to_change,
  field_names_to_view = NULL,
  upload_individually = TRUE
)

Arguments

project

A validated project object containing REDCap project data and settings. Generated using load_project or setup_project

optional_form

Optional data frame. A data frame containing the data to be edited. If not provided, the function will pull the data from the REDCap database using the specified field_name_to_change.

records

Character or numeric vector. The records to be edited. If not provided, the function will use the unique values from the specified forms.

field_name_to_change

Character. The field name to be changed in the REDCap database.

field_names_to_view

Optional character vector. A list of field names to view alongside the field being edited. Defaults to NULL, in which case only the field being changed will be viewed.

upload_individually

Logical. If TRUE, each change is uploaded individually. Default is TRUE.

Value

A modified project object with changes to the specified field(s) in the REDCap project.

Details

This function is useful when you want to edit specific fields in a REDCap project while also reviewing related data from other forms in the project. The field_name_to_change must be provided, and you can also specify additional fields to view while editing. The data is either passed through optional_form or pulled from the project based on the provided field names.

See also

save_project for saving the modified database.