nutterb / redcapAPI-Defunct

R interface to REDCap (http://www.project-redcap.org/)
42 stars 0 forks source link

importRecords fails when there are columns with numeric or integer constraints and missing values #167

Closed NikNakk closed 2 years ago

NikNakk commented 3 years ago

The existing code breaks when importing records that include numeric or integer columns that contain NAs.

baderstine commented 2 years ago

Yep. Try to run importRecords() with a redcap field that is defined as Text Box and Validation set to "Number". If your input dataset has missing data, I get the following error:

Error: Assigned data `""` must be compatible with existing data.
ℹ Error occurred for column `<name>`.
x Can't convert <character> to <double>.
MBeresf4d commented 2 years ago

Hi @baderstine, I got the same error before. I was using a list of record id from a xlsx file to export data from redcap, attach new record id from the same excel file, and then import into another redcap project. When importing records, I got the same error massage. I changed xlsx file to a csv file, and then was able to import records successfully.

baderstine commented 2 years ago

@MBeresf4d That sounds like a different issue. There are no CSV or XLSX files involved in calling the importRecords() function via the redcapAPI package.