Panel Visibility (depends / rejects)
Classic depends="$tokenName$" and rejects="$tokenName$" map to named conditions in expressions.conditions referenced by containerOptions.visibility.
When to load
Load when the classic XML has depends= or rejects= attributes on a <row>, <panel>, or viz element.
Supported conversions
depends="$token$"→expressions.conditionsentry +containerOptions.visibility.showConditions.rejects="$token$"→expressions.conditionsentry +containerOptions.visibility.hideConditions.- Both on the same element → emit both
showConditionsandhideConditions. - Empty-string sentinel patterns → equality-check condition instead of
$isSet.
Unsupported — warn or ask
- None. All
depends/rejectsforms convert.
Conversion rules
depends → showConditions
- Create a named condition using
$isSet($tokenName$):
"expressions": {
"conditions": {
"<tokenName>_show": {
"name": "<tokenName>_show",
"value": "$isSet($<tokenName>$)"
}
}
}
- Reference it in the viz’s
containerOptions.visibility.showConditions:
"viz_<id>": {
"type": "splunk.table",
"containerOptions": {
"visibility": {
"showConditions": ["<tokenName>_show"]
}
}
}rejects → hideConditions
Use hideConditions with the same $isSet(...) expression:
"<tokenName>_hide": { "name": "<tokenName>_hide", "value": "$isSet($<tokenName>$)" }"containerOptions": { "visibility": { "hideConditions": ["<tokenName>_hide"] } }
$isSet()— use$...$delimiters for reactivity: write$isSet($tokenName$), not the quoted$isSet("tokenName")form. Both forms evaluate correctly, but the delimiter form is what reliably re-evaluates the condition when the token changes. The quoted form (which the UDF docs show) is fine for a token that is already set at load, but in older Studio versions (verified onsplunk-dashboard-studio1.28.0) a condition written as$isSet("tokenName")does not react to live input changes — the panel stays hidden until reload. The dependency tracker wires reactivity off the$tokenName$delimiter, so always prefer it.
Scope rules
depends/rejectson<row>→ replicate condition on every viz in that rowdepends/rejectson<panel>→ apply to all vizzes inside that paneldepends/rejectson the viz element itself → apply only to that viz- Both
dependsandrejectson same element → emit bothshowConditionsandhideConditions
De-duplication
Multiple vizzes sharing the same token → reuse one condition entry in expressions.conditions. The same condition ID can appear in many vizzes’ arrays.
Key naming
depends="$foo$"→ keyfoo_show, namefoo_showrejects="$foo$"→ keyfoo_hide, namefoo_hide
Strip $ delimiters from the token name when building the key.
Custom equality conditions
For empty-string sentinel patterns (where depends doesn’t use a plain $isSet test), replace $isSet($token$) with an equality check:
"sourcetype_show": { "name": "sourcetype_show", "value": "$sourcetype$ != 'none'" }
See form-inputs.md for the full empty-string sentinel conversion pattern.
Examples
depends on a viz
"expressions": {
"conditions": {
"host_show": { "name": "host_show", "value": "$isSet($host$)" }
}
},
"visualizations": {
"viz_detail": {
"type": "splunk.table",
"containerOptions": { "visibility": { "showConditions": ["host_show"] } }
}
}rejects on a viz
"host_hide": { "name": "host_hide", "value": "$isSet($host$)" }"containerOptions": { "visibility": { "hideConditions": ["host_hide"] } }Report notes
- Note where a single condition was reused across multiple vizzes (de-duplication).
- Note any empty-string sentinel that was converted to an equality check rather than
$isSet.