Writing Expressions
Writing expressions in Talos is straightforward. There are a few simple rules for using variables, numbers, text, and operators.
Variables
Variables are pieces of information stored in your workflow. To use a variable in an expression, wrap its name in ${ }.
- To use a variable:
${VariableName} - Example:
${Price} * 1.2 - Example:
${UserRole} == "Admin"
Fixed Values (Literals)
You can use fixed values directly in your expressions.
| Value Type | How to Write it | Example |
|---|---|---|
| Numbers | Write them normally | 10, 3.14 |
| Text | Wrap in double quotes | "Hello", "My Report" |
| True / False | Use true or false | true |
| Lists | Use square brackets | [1, 2, 3] |
| Coordinates | Use parentheses | (100, 250) |
Using Operators
Operators are symbols used to calculate or compare values.
Calculating
+: Add numbers or combine text ("A" + "B"→"AB")-: Subtract numbers*: Multiply numbers/: Divide numbers%: Get the remainder of a division
Comparing
==: Check if two values are equal!=: Check if two values are not equal</>: Check if one value is less than or greater than another<=/>=: Check if one value is less than/greater than or equal to another
Combining
&&: Used when both conditions must be true||: Used when at least one condition must be true!: Used to reverse a true/false value
Properties and Functions
Every value in Talos has built-in Properties (information you can read) and Functions (actions you can perform). You access these using a dot (.).
- Properties (Read Information):
${MyString}.Length()(Gets the number of characters)${MyList}.Empty()(Checks if the list is empty)
- Functions (Perform Actions):
${MyString}.ToUpperCase()(Converts to uppercase)${MyList}.Append("New Item")(Adds an item to the list)