labkey.deleteRows Jon (LabKey DevOps)  2016-02-10 11:43
Status: Closed
 
Hi Laura,

I'm running on a Mac as well using the Rlabkey package 2.1.129 and running on R 3.2.3

Just curious, but do those Key values exist?

I managed to reproduce the same output from R, but only if I provided it with a Key value that was not on my list.

So if I had Key values 1 through 6 and I used a value of 10, it would show me $rows with list() rather than the content it deleted.

Example:

> deleterow <- data.frame(Key=10)
> deldata <- labkey.deleteRows(
+ baseUrl="https://www.labkey.org",
+ folderPath="/Support Tickets/Dashboards/JonY",
+ schemaName="lists",
+ queryName="ListTest",
+ toDelete=deleterow
+ )
> deldata
$rowsAffected
[1] 1

$queryName
[1] "ListTest"

$schemaName
[1] "lists"

$containerPath
[1] "/Support Tickets/Dashboards/JonY"

$rows
list()

$command
[1] "delete"


==============

> deleterow <- data.frame(Key=5)
> deldata <- labkey.deleteRows(
+ baseUrl="https://www.labkey.org",
+ folderPath="/Support Tickets/Dashboards/JonY",
+ schemaName="lists",
+ queryName="ListTest",
+ toDelete=deleterow
+ )
> deldata
$rowsAffected
[1] 1

$queryName
[1] "ListTest"

$schemaName
[1] "lists"

$containerPath
[1] "/Support Tickets/Dashboards/JonY"

$rows
$rows[[1]]
$rows[[1]]$EntityId
[1] "ac46c1e0-b18a-1033-9005-a3afb15921c0"

$rows[[1]]$Check
[1] FALSE

$rows[[1]]$Key
[1] 5

$rows[[1]]$Name
[1] "Joe"



$command
[1] "delete"



Notice how the first example using the Key value of 10 looks completely different than the other one with the Key value of 5?

I'm starting to think that the records you're trying to delete were already deleted, which is why this R script isn't working.

Regards,

Jon