Specify Specific Container for Query

LabKey Support Forum (Inactive)
Specify Specific Container for Query micahs  2015-01-20 15:10
Status: Closed
 
Hello -

I'm in the process of changing a query that currently uses:

QuerySettings settings...
settings.setContainerFilterName(ContainerFilter.Type.CurrentAndSubfolders.name());

What is the recommended approach for specifying a specific container in the 'container tree'?

Thanks -

Micah
 
 
Jon (LabKey DevOps) responded:  2015-01-22 17:07
Hi Micah,

Are you trying to just get a specific folder, a folder and the project associated with it, or something else entirely?

If you were to want to get just a specific folder, you would replace "CurrentAndSubfolders" with just "Current". If it was the current folder and the project it's under, you would use "CurrentPlusProject".

Doc Source: https://www.labkey.org/download/clientapi_docs/javascript-api/symbols/LABKEY.Query.html#.containerFilter

Is this what you were looking to do?

Regards,

Jon
 
jeckels responded:  2015-01-26 14:23
Hi Micah,

The primary container for a given query is specified on the UserSchema instead of the QuerySettings. Jon's suggestion is a good one when you want to see data for multiple containers instead of just the current one.

Thanks,
Josh