Do sums, format values and read JSON in a flow
The FLOW formulas for arithmetic, number and date formatting and text, every format they accept, and the two ways to pull a value out of a JSON reply.
Formulas let a flow work things out on the spot. A quote screen can multiply a monthly price by twelve, show a number the way your country writes it, or print a date from a booking. Write them straight into any text that accepts variables.
Variables are filled in first and formulas are worked out last, so a formula can use any variable. When one formula sits inside another, the inner one goes first:
Your annual total is FLOW.FORMATNUMBER(FLOW.CALCULATE($MONTHLY * 12, 2), DECIMALUS)
#FLOW.CALCULATE
FLOW.CALCULATE(expression, decimals) works out a sum.
| Input | Result |
|---|---|
FLOW.CALCULATE(19.90 * 3, 2) |
59.70 |
FLOW.CALCULATE($PRICE * $QTY + 15, 2) |
The price times the quantity, plus 15 |
FLOW.CALCULATE(10 / 4) |
2 |
FLOW.CALCULATE(10 / 4, 0) |
3 |
- It understands
+,-,*and/. Multiplication and division go before addition and subtraction. - Decimals are written with a point, as in
19.90. - No brackets and no negative numbers. Anything else, including a stray
letter, gives
0. - Decimals rounds the result. Leave it out and the decimals are cut off,
so
2.5becomes2.
#FLOW.FORMATNUMBER
FLOW.FORMATNUMBER(number, format) writes a number the way your readers
expect. For 1234.567:
| Format | Result |
|---|---|
DECIMALUS |
1,234.57 |
DECIMALNOUS |
1.234,57 |
DECIMALUSNOTHOUSANDS |
1234.57 |
DECIMALNOUSNOTHOUSANDS |
1234,57 |
NUMBERUS |
1,235 |
NUMBERNOUS |
1.235 |
INTEGER |
1235 |
- With no format, or a format that is not in the list, you get
DECIMALUS. - There is no currency format. Type the symbol yourself:
$FLOW.FORMATNUMBER($TOTAL, DECIMALUS)orR$ FLOW.FORMATNUMBER($TOTAL, DECIMALNOUS). - Tayon reads the first number in the value and ignores other characters. A
value with no number in it gives
0.
#FLOW.FORMATDATE
FLOW.FORMATDATE(date, format, us) rewrites a date and time.
The input must be a date followed by a time, such as 12/25/2026 3:30pm or
25/12/2026 15:30.
- The date can use
/or-. Leave the year out and the current year is used. - The time can be
15,15:30,3pmor3:30pm. A time is required. A date on its own is not understood. - us says how to read the date:
TRUE(the default) for month first,FALSEfor day first. - Dates written year first, such as
2026-12-25, are not understood.
For FLOW.FORMATDATE(12/25/2026 3:30pm, format):
| Format | Result |
|---|---|
TIMESTAMP (the default) |
2026-12-25T15:30:00 |
SQLDATETIME |
2026-12-25 15:30:00 |
SQLDATE |
2026-12-25 |
SQLTIME |
15:30:00 |
DATEUS |
12/25/2026 |
DATENOUS |
25/12/2026 |
DAY / MONTH / YEAR |
25 / 12 / 2026 |
HOUR / MINUTE |
15 / 30 |
A day-first input needs the third value:
FLOW.FORMATDATE(25/12/2026 15:30, DATEUS, FALSE) gives 12/25/2026.
When the input cannot be read, the formula prints Invalid date format followed by the input. A misspelled format prints Invalid output format.
#FLOW.SUBSTRING and FLOW.REPLACE
| Formula | What it does | Example |
|---|---|---|
FLOW.SUBSTRING(text, start, end) |
Takes part of a text. Counting starts at 0, and the character at end is not included. Leave end out to go to the end. |
FLOW.SUBSTRING(ABCDEF, 0, 3) gives ABC |
FLOW.REPLACE(text, find, replace) |
Swaps every find for replace. | FLOW.REPLACE($PHONE, -, .) turns 555-0100 into 555.0100 |
FLOW.REPLACE needs all three values. It cannot replace text with nothing.
#Reading a value from a JSON reply
When an API/Webhook Call with Return Type set to JSON Response
stores its reply under an identifier, you can print single values from it.
Say the reply stored as CUSTOMER is:
{"name": "Maya", "address": {"city": "Lisbon"}, "orders": [{"id": "A1"}, {"id": "B2"}]}
There are two ways to reach inside it.
#Square brackets after the identifier
Put the path in one pair of brackets, with : between the steps.
| You write | You get |
|---|---|
$CUSTOMER[name] |
Maya |
$CUSTOMER[address:city] |
Lisbon |
$CUSTOMER[orders:0:id] |
A1. Positions in a list start at 0. |
When the whole reply is a list, add the position after the path, counting from
1: $RESULTS[name][2] is the name in the second item. The position can be a
variable: $RESULTS[name][$CHOICE].
#The JSON() formula
JSON() puts each step in its own brackets, and positions start at 0.
| You write | You get |
|---|---|
JSON($CUSTOMER[address][city]) |
Lisbon |
JSON($CUSTOMER[orders][1][id]) |
B2 |
JSON() also works on the left side of a split condition, as in
JSON($CUSTOMER[address][city]) = Lisbon.
#When the value does not come out
- Names must match exactly, capitals included:
[City]does not findcity. - A path that leads nowhere prints nothing in the bracket form, and
nullinJSON(). - These only work when the stored reply is a JSON object, or a list of objects.
- Use one form per field. When a text contains
JSON(, the bracket form in the same text is not filled in.
Updated: