Hello,
I am having several errors when trying to use the R labkey API to create and load a dataset. I am able to load this same file as a dataset using the GUI, but cannot seem to do it with the R API.
When creating the design, I get an error about reserved fields. In the GUI I resolve this by matching specific upload file column names with reserved field names. I don't know how to do this in R:
fields <- labkey.domain.inferFields(baseUrl=labkey.getBaseUrl(), folderPath=fp, df=inDF)
dd <- labkey.domain.createDesign(name=batch$batch, fields=fields)
k = which(dd$fields$name %in% c("ParticipantId", "visitCode", "sampleName"))
dd$fields$isPrimaryKey[k] = TRUE
eaLabkeyList = labkey.domain.create(baseUrl=labkey.getBaseUrl(), folderPath=fp, domainKind="StudyDatasetVisit", domainDesign=dd, options=list(categoryName="SequencingTest",demographics=FALSE,useTimeKeyField=FALSE,keyPropertyName="sampleName"))
Error:
HTTP request was unsuccessful. Status code = 500, Error message = java.lang.IllegalArgumentException: Property: ParticipantId is reserved or exists in the current domain.
Once I create this file in the web UI, I'm not able to append other data to it by upload since the column names don't match. Is there some documentation for how to take care of the key name matching so I can do this in R?
Thanks for any help.