Fetch a list of named query views available to the current user in a specified folder context, schema and query
labkey.getQueryViews(baseUrl, folderPath, schemaName, queryName)
a string specifying the address of the LabKey Server, including the context root
a string specifying the hierarchy of folders to the current folder (container) for the operation, starting with the project folder
a string specifying the schema name in which the query object is defined
a string specifying the name the query
The available views for a query are returned as a three-column data frame, with one row per view output field.
viewName
The name of the view, or NA for the default view.
fieldName
The name of a field within the view, as defined in the query object to which the field belongs
key
The name of the field relative to the base query, Use this value in the colSelect parameter of labkey.selectRows()
.
Queries have a default “view” associeated with them, and can also have any number of named views.
A named query view is created by using the “Customize View” button option on a LabKey data grid page.
Use getDefaultViewDetails
to get inforation about the default (unnamed) view.
https://www.labkey.org/Documentation/wiki-page.view?name=savingViews
Retrieve data: labkey.selectRows
,makeFilter
, labkey.executeSql
Modify data: labkey.updateRows
, labkey.insertRows
, labkey.importRows
, labkey.deleteRows
List available data: labkey.getSchemas
, labkey.getQueries
,
labkey.getQueryDetails
,labkey.getDefaultViewDetails
,labkey.getLookupDetails
# NOT RUN {
## List of views defined for a query in a schema
# library(Rlabkey)
viewsDF <- labkey.getQueryViews(
baseUrl="http://localhost:8080/labkey",
folderPath="/apisamples",
schemaName="lists",
queryName="AllTypes"
)
# }
Run the code above in your browser using DataLab