Query Scope: Filter by Folder

_Documentation

Overview

Certain LabKey queries (such as assay designs, issue trackers, and survey designs) can be defined at the project level. Data associated with such queries may be located within individual subfolders. You can adjust the scope of queries on such data to cover all data on the site, all data for a project, or only data located in particular folders. Scope is controlled using the "Filter by Folder" option on the views menu in the webpart.

This allows you to organize your data in folders that are convenient to you at the time of data collection (e.g., folders for individual labs or lab technicians). Then you can perform analyses independently of the folder-based organization of your data. You can analyze data across all folders, or just a branch of your folder tree.

You can set the scope through either the "Views" menu (above a grid view) or through the client API. In all cases, LabKey security settings remain in force, so users only see data in folders they are authorized to see.

Folder Filter Interface

To filter by folder through the user interface, click the Views menu above a grid for an appropriate query (e.g., an assay or issues grid) and choose one of the following:

  • Current folder
  • Current folder and subfolders
  • All folders (on the site)

Folder Filters in the JavaScript API

The LabKey API provides developers with even finer grain control over the scope.

The containerFilter config property available on many methods on LABKEY.Query (such as LABKEY.Query.executeSql and LABKEY.Query.selectRows) provides fine-grained control over which folders accessed through the query.

For example, the LABKEY.Query.executeSql API allow you to use the containerFilter parameter to run custom queries across data from multiple folders at once. This query might (for example) show the count of NAb runs available in each lab’s subfolder if folders are organized by lab.


previousnext
 
expand allcollapse all