Parts of a document can be shown or hidden at runtime based on the results of a DQL query — for example, showing a "Kubernetes" tab only for hosts that are Kubernetes nodes.
This page covers DqlConditionsContext, the Conditional mixin, and the Condition union (DqlVariableCondition, ExtensionConfiguredCondition), including the ConditionValue type used by variable conditions.
conditionContext at its root — one or more DQL queries to run once, up front.conditions array; each condition tests a variable. An element only renders when all of its conditions are satisfied (AND semantics).Condition variables are a separate channel from regular DQL query variables used elsewhere in the document (for example, table queries) — they exist only to drive visibility decisions.
DqlConditionsContextDeclared once, at the document root.
| Property | Type | Description |
|---|---|---|
|
| One or more DQL queries whose result fields become condition variables. |
|
| Field names to extract from the query result. When omitted, all result fields are extracted. |
conditionContext: {query: 'smartscapeNodes "HOST" | filter id == toSmartscapeId($(nodeId)) | fieldsAdd isK8s = isNotNull(fromRelationship.isNodeOf) | limit 1 | fields isK8s',resultFields: ['isK8s'],}
Conditional mixinAny element type that supports conditions intersects with this mixin:
| Property | Type | Description |
|---|---|---|
|
| If provided, the element renders only when every condition is satisfied. |
Condition is a discriminated union on type.
DqlVariableConditionTests a condition variable produced by conditionContext against an expected value.
| Property | Type | Description |
|---|---|---|
|
| Discriminant. |
|
| Name of the condition variable to test. |
|
| Expected value. A single value means equality; an array means OR (matches if the variable equals any entry). |
{ "type": "dql-variable", "variable": "isK8s", "value": true }
{ "type": "dql-variable", "variable": "region", "value": ["eu", "us"] }
ExtensionConfiguredConditionTests whether the extension that shipped the document is installed and, optionally, meets version/feature-set/host-activation requirements.
| Property | Type | Description |
|---|---|---|
|
| Discriminant. |
|
| Minimum extension version (semver). |
|
| Maximum extension version (semver). |
|
| Matches if any of the listed feature sets is enabled in a matching monitoring configuration (OR semantics, case-insensitive). |
|
| When set, only monitoring configurations scoped to the current entity are considered. Works for host configurations. |
The extension's identity is resolved automatically from the document's origin — there's no extensionId field to set on the condition itself.
This Entity Details definition runs one condition query that resolves an isK8s variable, then uses it to show a "Kubernetes" tab only for hosts that are Kubernetes nodes. The "Overview" tab has no conditions, so it always renders.
{"version": "1.3.0","type": "EntityDetailsDefinition","target": { "app": "dynatrace.infraops", "nodeType": "dt.entity.host" },"conditionContext": {"query": "smartscapeNodes \"HOST\" | filter id == toSmartscapeId($(nodeId)) | fieldsAdd isK8s = isNotNull(fromRelationship.isNodeOf) | limit 1 | fields isK8s","resultFields": ["isK8s"]},"content": {"type": "details","id": "host-details","content": {"type": "tabs","items": [{"type": "tab","id": "overview","title": "Overview","content": [{ "type": "metadata", "id": "host-properties", "cardTitle": "Properties" }]},{"type": "tab","id": "kubernetes","title": "Kubernetes","conditions": [{ "type": "dql-variable", "variable": "isK8s", "value": true }],"content": [{ "type": "message", "id": "k8s-note", "content": "Shown only for Kubernetes nodes." }]}]}}}
| Site | Evaluated |
|---|---|
A | before the layout is built |
Items inside a tab's | before the layout is built |
Health alert groups and individual health alerts | before the layout is built |
DQL table columns | before the layout is built |
Filters inside a filtering element | before the layout is built |
Chart group sections and individual charts | before the layout is built |
Actions (header, toolbar, card, chart, column, row, cell) | at render time, with row/cell data available where relevant |
conditionContext, all conditions fields are ignored and every element renders unconditionally.
ExtensionsInfrastructure Observability