Conditional actions
Run one or more journal action steps only when a CSS selector is present on the page — or only when it is missing.
What you get
Conditional actions let you branch automation based on page state. For example, run fill steps when a replay panel is visible, or skip them when it is not.
How to set one up
Content is a single JSON object with mode ("if" or "ifNot"), selector (CSS selector to check), and then (array of steps). Use "if" to run then when the selector matches an element; use "ifNot" when the element is absent.
Nested steps
Each item in then must set action explicitly (click, fillData, fillFromHistory, or conditional). Steps run in order when the condition matches. A miss skips all then steps silently — no error is shown.
Nested conditionals
then steps may include further conditional actions for deeper branching. Nesting is limited to eight levels to prevent runaway recursion.
Examples
Runs nested steps only when the replay panel selector exists on the page. Use mode "ifNot" to run steps when the selector is missing. Nested steps must set action explicitly.
{
"name": "Replay open — forward then fill",
"site": "*.tradingview.com",
"location": "toolbar",
"action": "conditional",
"iconId": "play",
"content": {
"mode": "if",
"selector": "[data-name=\"replay-trading\"]",
"then": [
{
"action": "click",
"content": {
"selector": "[class*=controls__control_type_forward] span"
},
"waitMs": 100
},
{
"action": "fillData",
"content": {
"symbol": "[data-label=\"symbol\"]"
}
}
]
},
"enabled": true,
"sortOrder": 0
}