RLabkey makeFilter with filters as variable?

LabKey Support Forum (Inactive)
RLabkey makeFilter with filters as variable? Jon (LabKey DevOps)  2018-01-15 15:45
Status: Closed
 
Hi Ben,

Are you using "EQUALS" or "EQUAL"?

Using the export option on a grid to get the R code, the filter normally appears like this:

    colFilter=makeFilter(c("myColumn", "EQUAL", "value1"),c("myColumn2", "CONTAINS", "value2")),

For example:

labkey.data <- labkey.selectRows(
    baseUrl="http://localhost:8080/labkey",
    folderPath="/myProject",
    schemaName="lists",
    queryName="myList",
    viewName="",
    colFilter=makeFilter(c("myColumn", "EQUAL", "value`"),c("myColumn2", "CONTAINS", "value2")),
    containerFilter=NULL
)

I tested this out on my end using the following code which worked for me:

library(Rlabkey)

myFilter <- (c("firstField", "EQUAL", "value1"),c("secondField", "EQUAL", "value2"))

labkey.data <- labkey.selectRows(
    baseUrl="http://localhost:8080/labkey",
    folderPath="/myProject",
    schemaName="lists",
    queryName="myList",
    viewName="",
    colFilter=makeFilter(myFilter),
    containerFilter=NULL
)

labkey.data


Regards,

Jon