containerFilter on queries for lists schema

LabKey Support Forum (Inactive)
containerFilter on queries for lists schema Anthony Corbett  2012-05-22 09:21
Status: Closed
 

I'm trying to query lists with the same name in two different subFolders. At the common parent container I create a LABKE selectRows query for the lists and common query name and then set the containerFilter to CurrentAndSubfolders but I receive a 404 Error that it can't find the queryName.

My request looks like this:

{"schemaName":"lists","apiVersion":9.1,"containerFilter":"CurrentAndSubfolders","query.maxRows":0,"query.queryName":"Events","limit":10000,"page":1,"start":0,"commands":[]}


The error is:

    "exceptionClass": "org.labkey.api.view.NotFoundException",
    "exception": "Query 'Events' in schema 'lists' doesn't exist.",
    "stackTrace": [
        "org.labkey.query.controllers.QueryController.ensureQueryExists(QueryController.java:296)",
        "org.labkey.query.controllers.QueryController$SelectRowsAction.execute(QueryController.java:2327)",
     . . .


Is it not possible to use the containerFilter for the lists schema?

Thanks!
 
 
Matthew Bellew responded:  2012-05-22 09:26
Lists do not currently support shared definitions (say like Assays do). Each list in each folder is a separate table belonging to one container, so your container filter strategy won't work.

You could consider

* use a UNION query
* create a table using a file-based module https://www.labkey.org/wiki/home/Documentation/page.view?name=sqlScripts
* keep the list in one folder (e.g. /shared) and have other folders all point to the same list.

Matt
 
Ben Bimber responded:  2012-05-22 09:28
Hi Anthony,

In addition to matt's comment, you might consider:

1) create a hard table in an external schema or schema defined through a custom module. these tables can be shared across containers.

2) if you could use an assay, that assay could be defined at the project level or in /shared, in which case it will be visible to subfolders.

depending on your application, you might also be able to to have a single list located in 1 container, then view/insert records into this list from both containers (see containerPath on most APIs and the QueryWebpart).