Using Expressions
Expressions allow you to make your Talos workflows dynamic. Instead of using fixed values, you can use expressions to calculate numbers, manipulate text, and use information stored in variables.
Where to use Expressions
Almost every field (property) in a Talos Action supports expressions. There are three main ways you will use them:
1. Dual-Mode Inputs ([fx] Toggle)
For numeric, path, and assignment fields, Talos provides an [fx] toggle button directly next to the input:
- Literal Mode (Default): Enter static values easily using friendly widgets (such as numeric steppers, file/directory pickers, or plain unquoted text).
- Expression Mode (
[fx]active): Click[fx]to switch the input into an expression field. You can now use${variables}, arithmetic calculations, and methods. In Expression Mode, literal text must be wrapped in double quotes (e.g."my_file.txt").
2. Direct Expressions
In dedicated expression fields (like Branch conditions, loop termination conditions, and filter predicates), you write expressions directly:
- Example:
10 + 5 - Example:
${Counter} > 0 - Example:
${Counter} >= 5 - Example:
${Status} == "completed"
3. Dynamic Text (Template Strings)
In fields that expect text (like an Email Subject, Log Message, or File Path), you can write normal text and insert dynamic tokens by wrapping expressions in double curly braces {{ }} or clicking the {+} variable inserter button:
- Example:
The current count is {{ ${Counter} }} - Example:
C:\Reports\Status_{{ ${ReportDate} }}.txt
Why use Expressions?
Expressions are essential for:
- Performing Calculations: Adding numbers, calculating totals, or incrementing counters.
- Dynamic Paths: Creating file paths that include dates or specific names.
- Data Manipulation: Converting text to uppercase, extracting parts of a string, or getting items from a list.
- Decision Making: Comparing values to decide which path a workflow should take.