19. Read values with expressions
Expressions are small JSON dictionaries with one special key. The runner resolves them when it reaches the node, so a later node sees values changed by an earlier one.
| Expression | Reads |
|---|---|
| {"$var":"score"} | The live project/runtime variable score. |
| {"$context":"entityId"} | entityId supplied by the event or caller. |
| {"$this":"id"} | The captured caller’s ID. |
| {"$this":"name"} | The captured caller’s name property. |
| {"$param":"amount"} | The named parameter of the current exposed visual function. |
| {"$arg":0} | The first positional call argument; 1 means the second. |
Use these in fields labeled as JSON values, such as If Compare Left/Right, Return Value, Call Script Arguments, Change Variable Value and Emit Event context. Call Script Function supplies its own Expression checkbox for each named parameter.
{
"owner": {"$this":"id"},
"amount": {"$param":"amount"},
"items": ["brass_key_item", {"$var":"score"}]
}Values are resolved recursively inside arrays and dictionaries. A dictionary used as a special expression must contain just that special key. The dictionary above is an ordinary result object whose individual values contain expressions.
These are lookups, not arbitrary formula strings. {"$var":"score + 1"} looks for a variable literally named score + 1. Use Change Variable → add for the arithmetic.
