Values, Variables & Expressions
Almost every action has a field where you type a value — Notification messages, Create variable, conditions, loops, action parameters. Into that one field you can put plain text, insert variables, or have a value calculated. This page covers both the everyday cases and the advanced ones.
Two rules that get you most of the way
- What you type is text. No quotes needed —
Good morningis simply the textGood morning. - A variable is marked with
$. Type$and the auto-completer opens with the list of variables. Without$, the name is treated as an ordinary word.
The examples below assume these variables:
| Variable | Value | Type |
|---|---|---|
$name | Jan Novák | text |
$amount | 1250.5 | number |
$count | 3 | number |
$invoice_no | 2024001 | number |
$date | 01.02.2024 | text |
$text | ' Invoice 2024 ' | text with spaces |
$items | ['apples', 'pears', 'plums'] | list |
$record | {'id': 7, 'state': 'OK'} | dictionary |
$note | '' | empty text |
Everyday use
Text with variables
The most common case. Write a sentence and put $ wherever a value should be substituted.
No quotes, no plus signs.
| You type | Result |
|---|---|
Record $name cannot be processed | Record Jan Novák cannot be processed |
Good morning $name, thank you for your order. | Good morning Jan Novák, thank you for your order. |
Error (code $invoice_no): processing failed. | Error (code 2024001): processing failed. |
Full stops, commas, colons, brackets, dashes and percent signs are ordinary punctuation — type them freely. Spaces stay exactly as you write them, including after a variable.
Numbers in text
Numbers mix into text without restriction, whether typed directly or coming from a variable. Everything is converted to text automatically.
| You type | Result |
|---|---|
Invoice number $invoice_no has been paid | Invoice number 2024001 has been paid |
We have $count items for $amount CZK. | We have 3 items for 1250.5 CZK. |
In earlier versions this combination of text and a number ended with an error. It now works.
A single value keeps its type
When the field contains just one thing, you get exactly that — text stays text, a number stays a number, and a variable keeps its own type.
| You type | Result |
|---|---|
$name | Jan Novák — the value with its type |
approved | approved — text |
42 | 42 — number |
"42" | 42 — text, not a number |
Put a digit in quotes when you need it as text. The quotes are preserved in the field.
Calculating
Numbers can be used in arithmetic. Leave spaces around the operator, or use brackets — that is how the Editor tells a calculation from text.
| You type | Result |
|---|---|
$amount * 1.21 | 1513.105 |
$invoice_no + 1 | 2024002 |
($amount + 100) / 2 | 675.25 |
20240201-001 | 20240201-001 — text, not subtraction |
Without spaces around the operator the value is taken as text, so document numbers and payment references stay intact.
The auto-completer
- Type
$and the list of variables opens; pick one and the full name is inserted. - The word before
$is kept — typingGood morningand then$does not overwrite it. - Want a space? Type it yourself:
Good morning $name. - Tabs at the top hold more than variables: Variables, Operators, Constants, General, Math, Text and Date & Time. The selected item is inserted together with an example of its syntax.
- Colour highlighting marks variables inside the field, so you can see at a glance what gets substituted and what is plain text.
- The preview under the field shows the result. Green means fine; red means an error — most often a typo in a variable name.
Saving and reopening
The value is stored so that it always behaves the same way. Reopen the action and you see it back in readable form, not in a technical notation:
| You type | After reopening |
|---|---|
Record $name cannot be processed | Record $name cannot be processed |
Older scenarios open correctly too. Even where a value was written the old way — with quotes and plus signs — it is displayed in the new readable form and behaves as before.
Common mistakes
| You type | Result | Fix |
|---|---|---|
name | name — an ordinary word, not the value | The $ is missing. Use $name. |
Good morning$name | Good morningJan Novák | Space missing before $: Good morning $name. |
$naame | red preview — the variable does not exist | Typo. Pick the variable from the auto-completer. |
Advanced expressions
The field also accepts calculations, text manipulation, date handling and conditions. The
notation is Python; variables are still marked with $.
Reaching into data
When a variable holds a list or a dictionary, square brackets get you inside. After you type
[, the auto-completer offers the keys or positions directly.
| You type | Result |
|---|---|
$items[0] | apples — first element, counting from zero |
$items[-1] | plums — last element |
$record['state'] | OK — value by key |
$record['id'] | 7 |
$name[0:3] | Jan — first three characters |
The same notation slices a list.
Working with text
Write a dot after the variable and the name of an operation:
| You type | Result |
|---|---|
$name.upper() | JAN NOVÁK |
$text.strip() | Invoice 2024 — trims leading and trailing spaces |
$name.replace('Novák', 'Nový') | Jan Nový |
$date.split('.') | ['01', '02', '2024'] |
", ".join($items) | apples, pears, plums |
$text.strip().lower() | invoice 2024 — operations chain |
Functions
The General and Math tabs of the auto-completer list what is available, each with a description and an example.
| You type | Result |
|---|---|
len($items) | 3 — number of elements |
len($name) | 9 — number of characters |
int($amount) | 1250 |
str($count) | 3 — as text |
round($amount) | 1250.0 |
max($count, 10) | 10 — larger of the two; min likewise |
sum([1, 2, 3]) | 6 |
abs(-5) | 5 |
Lists, dictionaries and tuples
Useful when you need to pass several values at once — into a form, or on to another action.
| You type | Result |
|---|---|
[$name, $count] | ['Jan Novák', 3] — list |
{id:$count, name:$name} | {'id': 3, 'name': 'Jan Novák'} — dictionary |
($count, $amount) | (3, 1250.5) — tuple |
Key names need no quotes. After reopening you see them quoted — {'id':$count, …} — which
is the same thing.
Mind the difference: $count, $amount with nothing else is a tuple, whereas
We have $count for $amount CZK is text.
Date and time
A date stored as text must first be parsed with datetime_parse and then rendered with
datetime_format.
| You type | Result |
|---|---|
datetime_parse($date, '%d.%m.%Y') | the date read from the text |
datetime_format(datetime_parse($date, '%d.%m.%Y'), '%Y-%m-%d') | 2024-02-01 |
datetime_format(datetime.datetime.now(), '%d.%m.%Y') | today's date |
datetime_format(datetime_add(datetime.datetime.now(), days=7), '%d.%m.%Y') | the date a week from now |
| Helper | What it takes |
|---|---|
datetime_parse(text, format, tz=None) | Reads a date out of text. |
datetime_format(date, format) | Renders a date as text. |
datetime_add(date, …) | Shifts a date by days, hours, minutes, seconds, microseconds, months or years. |
datetime_set(date, …) | Sets a specific part — day, month, year, hour, minute, second, microsecond. |
Format codes: %d day, %m month, %Y four-digit year, %H hour, %M minute.
Constants and system values
The Constants tab holds ready-made values; picking one inserts the whole expression.
| You type | Result |
|---|---|
datetime.datetime.now() | current date and time |
int(datetime.datetime.now().timestamp()) | seconds since the epoch, e.g. 1785841813 |
random.randint(1, 100) | a random number |
$CONSTANTS['FULL_DATE'] | a scenario-wide constant — see the full list |
Modules
Five modules are available: re, math, random, datetime and
aiviro.
| You type | Result |
|---|---|
re.sub('[0-9]', '', $text) | ' Invoice ' — strips all digits |
math.ceil($amount) | 1251 — rounds up |
random.randint(1, 100) | a random number from 1 to 100 |
Number bases
| You type | Result |
|---|---|
bin($count) | 0b11 |
hex($count) | 0x3 |
oct($count) | 0o3 |
int("1100", 2) | 12 — from binary text back to a number |
Operators
Every operator below is also in the Operators tab of the auto-completer, with a description.
Arithmetic
| You type | Result | Meaning |
|---|---|---|
$amount + $count | 1253.5 | add |
$amount - $count | 1247.5 | subtract |
$amount * $count | 3751.5 | multiply |
$amount / $count | 416.833… | divide — result is a decimal |
$amount // $count | 416.0 | integer division |
$amount % $count | 2.5 | remainder — handy for odd/even tests |
$count ** 2 | 9 | power |
Joining and repeating
+ and * work on text and lists too — there they join and repeat rather than add.
| You type | Result |
|---|---|
$items + ["berries"] | ['apples', 'pears', 'plums', 'berries'] |
"-" * 20 | -------------------- — a separator |
You do not need + to build text from variables — just write the sentence and mark the
variables with $.
Comparison
Used mostly in Condition and loop actions, where the Editor asks "should this run?". The
answer is True or False.
| You type | Result | Meaning |
|---|---|---|
$amount > 1000 | True | greater than; < is less than |
$count <= 3 | True | less than or equal; >= likewise |
$record['state'] == "OK" | True | equals — note the two equals signs |
$name != "Petr" | True | does not equal |
Logic
| You type | Result | Meaning |
|---|---|---|
$amount > 1000 and $count > 1 | True | both must hold |
$amount > 5000 or $count > 1 | True | at least one must hold |
not $note | True | negation — holds when the value is empty |
$count > 1 and $count < 10 | True | a range |
Empty text, zero and an empty list count as "no"; anything filled in counts as "yes".
Contains / is inside
| You type | Result |
|---|---|
"apples" in $items | True |
"bananas" not in $items | True |
"state" in $record | True — does the dictionary have that key? |
"Novák" in $name | True — substring search in text |
$note is None | False — empty text is not the same as None |
Two useful tricks
| You type | Result |
|---|---|
$note or "not filled in" | not filled in — a fallback when the variable is empty |
len($items) > 2 | True — a condition built on a function's result |
One-line conditions
For a simple "if yes then A, otherwise B", write the condition straight into the field — typically in Create variable.
| You type | Result |
|---|---|
"VIP" if $amount > 1000 else "standard" | VIP |
$name if $name else "unknown customer" | Jan Novák, or unknown customer if $name were empty |
Transforming and filtering a list
One line can walk a list and change or filter each item.
| You type | Result |
|---|---|
[i.upper() for i in $items] | ['APPLES', 'PEARS', 'PLUMS'] |
[i for i in $items if i != 'pears'] | ['apples', 'plums'] |
len([i for i in $items if i != 'pears']) | 2 |
i is just a helper name for one item — it takes no $.
F-strings
An f-string is text with values substituted in, what used to be written as
f"text {variable}". You no longer need to write it: type the text and mark variables with
$, and the Editor builds the f-string itself.
| You type | Result |
|---|---|
Record $name cannot be processed | Record Jan Novák cannot be processed |
f"Hello {name}" | Hello Jan Novák |
Written by hand it works too. Inside the braces, though, no $ — {name} is right,
{$name} is not. After reopening you see the simpler form, Hello $name.
Older scenarios containing f-strings keep working and open correctly.
When to reach for Python Code instead
The value field is meant for one value on one line. As soon as you need several steps in sequence, loops, error handling or longer logic, use the Python Code action — there you get a full editor and the code stays readable.