labkey.getQueryDetails(baseUrl, folderPath, schemaName, queryName)
queryName
{the name of the query, repeated n times, where n is the number of output fields from the query}
fieldName
{the fully qualified name of the field, relative to the specified queryName. }
caption
{a more readable label for the data field, appears as a column header in grids}
fieldKey
{the name part that identifies this field within its containing table, independent of its use as a lookup target.}
type
{a string specifying the field type, e.g. Text, Number, Date, Integer}
isNullable
{TRUE if the field can be left empty (null)}
isKeyField
{TRUE if the field is part of the primary key}
isAutoIncrement
{TRUE if the system will automatically assign a sequential integer in this on inserting a record}
isVersionField
{TRUE if the field isused to detect changes since last read}
isHidden
{TRUE if the field is not displayed by default}
isSelectable
{reserved for futre use. }
isUserEditable
{reserved for futre use.}
isReadOnly
{reserved for futre use}
isMvEnabled
{reserved for futre use}
lookupKeyField
{for a field defined as a lookup the primary key column of the query referenced by the lookup field; NA for non-lookup fields}
lookupSchemaName
{the schema of the query referenced by the lookup field; NA for non-lookup fields}
lookupDisplayField
{the field from the query referenced by the lookup field that is shown by default in place of the lookup field; NA for non-lookup fields}
lookupQueryName
{the query referenced by the lookup field; NA for non-lookup fields. A non-NA value indicates that you can use this field in a call to getLookups}
lookupIsPublic
{reserved for futre use}
labkey.getQueryDetails
function. Function arguments are the components of the url that identify
the location of the server, the folder path, the schema, and the name of the query.
The results from getQueryDetails describe the ParticipantId/CohortId/CohortName
could be a reference to a CohortName
field
in a Cohorts
data set.These lookup fieldNames can appear in the default view and show up in the selectRows result. If a field from a lookup table
is not in the default view, it can still be added to the output column list of labkey.selectRows
. Use the
labkey.getLookups to discover what additonal fields are available via lookups, and then put their multipart fieldName values
into the colSelect list. Lookup fields have the semantics of a LEFT JOIN in SQL, such that
every record from the target queryName apprears in the output whether or not there is a matching lookup field value.
labkey.selectRows
, makeFilter
, labkey.executeSql
Modify data:## Details of fields of a query
# library(Rlabkey)
queryDF<-labkey.getQueryDetails(
baseUrl="http://localhost:8080/labkey",
folderPath="/apisamples",
schemaName="lists",
queryName="AllTypes")
Run the code above in your browser using DataLab