Variable Chaining
Variables can reference other variables, allowing you to build complex workflows where one variable's output feeds into another.
Clipboard → Form Default
The most common chain: grab clipboard content and pre-fill it in a form field for editing.
- trigger: ":edit"
replace: "{{form.content}}"
vars:
- name: clip
type: clipboard
- name: form
type: form
params:
layout: |
Edit content:
[[content]]
fields:
content:
multiline: true
default: "{{clip}}"
Shell → Form Values
Use shell output to populate a choice/list field dynamically.
- trigger: ":deploy"
replace: "Deploying {{form.server}} with {{form.branch}}"
vars:
- name: servers
type: shell
params:
cmd: "cat ~/servers.txt"
- name: branches
type: shell
params:
cmd: "git branch --list | cut -c3-"
- name: form
type: form
params:
layout: |
Server: [[server]]
Branch: [[branch]]
fields:
server:
type: choice
values: "{{servers}}"
branch:
type: choice
values: "{{branches}}"
Date → Form → Shell → Output
A 4-step chain: get date, show form, run shell command with form values, output result.
- trigger: ":report"
replace: "{{result}}"
vars:
- name: date
type: date
params:
format: "%Y-%m-%d"
- name: form
type: form
params:
layout: |
Date: [[date]]
Ticket: [[ticket]]
Description:
[[desc]]
fields:
date:
default: "{{date}}"
ticket:
placeholder: "JIRA-123"
desc:
multiline: true
- name: result
type: shell
params:
cmd: "echo '{{form.ticket}}: {{form.desc}} ({{form.date}})'"
Flow Diagram
Important Notes
- Variables are resolved in the order they are defined
- A variable can only reference variables defined before it
- Circular references will cause resolution failure
- Shell variables in form defaults are evaluated before the form opens
What's Next
Learn about System-Wide Mode for expansion in any application.