FlowmageDocs

Dates, text and lists recipes

Ready-made expressions for the jobs flows do most: format a date, tidy up a name or an e-mail address, count a list or join it into one line.

Each recipe runs on its sample; edit either to try your own. In a node's field, wrap the expression in {{ }} and use your own field for json.….

Dates

Show a date as day, month and year

formatDate turns a date into text with a pattern of yyyy, MM, dd, HH, mm, ss and SSS. Other letters are refused.

Expression
{{ formatDate(json.orderedAt, "dd-MM-yyyy") }}
Input (json)
{
  "orderedAt": "2026-07-21T09:00:00Z"
}

Show the time in a time zone

The third argument names the time zone. Without one, a flow uses your workspace's time zone; this page uses UTC.

Expression
{{ formatDate(json.orderedAt, "dd-MM-yyyy HH:mm", "Europe/Amsterdam") }}
Input (json)
{
  "orderedAt": "2026-07-21T09:00:00Z"
}

Work out a due date

addDays moves a date by days: here, 30 days after the invoice date.

Expression
{{ formatDate(addDays(json.invoiceDate, 30), "dd-MM-yyyy") }}
Input (json)
{
  "invoiceDate": "2026-07-21"
}

Go back a week

A negative number goes back.

Expression
{{ addDays(json.date, -7) }}
Input (json)
{
  "date": "2026-07-21T09:00:00Z"
}

Today's date

$macro.date.iso() is the moment the node runs.

Expression
{{ formatDate($macro.date.iso(), "yyyy-MM-dd") }}

Text

Put a first and last name together

Text around and between expressions is kept.

Expression
{{ json.firstName }} {{ json.lastName }}
Input (json)
{
  "firstName": "Anna",
  "lastName": "de Vries"
}

Take the first name from a full name

split cuts at every space; first takes the first part.

Expression
{{ first(split(json.name, " ")) }}
Input (json)
{
  "name": "Anna de Vries"
}

Tidy up an e-mail address

trim drops the spaces at both ends; lower makes every letter small.

Expression
{{ lower(trim(json.email)) }}
Input (json)
{
  "email": "  Anna@Acme.NL "
}

Remove every space

replace replaces every match, not only the first.

Expression
{{ replace(json.iban, " ", "") }}
Input (json)
{
  "iban": "NL91 ABNA 0417 1643 00"
}

Use a fallback when a field is missing

?? gives the right-hand value when the left is missing. Empty text is not missing: it stays empty.

Expression
{{ json.phone ?? "unknown" }}
Input (json)
{
  "name": "Anna"
}

Put a number in a sentence

Write the number as its own expression. "Order " + json.id is refused: + adds two numbers or joins two texts, never one of each.

Expression
Order {{ json.id }} is on its way
Input (json)
{
  "id": 1042
}

Lists

Count the items

length counts a list's items.

Expression
{{ length(json.items) }}
Input (json)
{
  "items": [
    {
      "sku": "A1"
    },
    {
      "sku": "B2"
    },
    {
      "sku": "C3"
    }
  ]
}

Join a list into one line

join makes one text, with what you name between the items.

Expression
{{ join(json.tags, ", ") }}
Input (json)
{
  "tags": [
    "new",
    "vip",
    "newsletter"
  ]
}

Take one item

first and last take the ends. Square brackets take a position counting from 0, so [1] is the second item.

Expression
{{ json.items[1].sku }}
Input (json)
{
  "items": [
    {
      "sku": "A1"
    },
    {
      "sku": "B2"
    },
    {
      "sku": "C3"
    }
  ]
}

Remove duplicates

unique keeps the first of each value, in order.

Expression
{{ unique(json.tags) }}
Input (json)
{
  "tags": [
    "vip",
    "new",
    "vip"
  ]
}

Turn a line of text into a list

split cuts at every comma.

Expression
{{ split(json.codes, ",") }}
Input (json)
{
  "codes": "A1,B2,C3"
}

How they behave

  • A field that is one expression and nothing else keeps the value's kind: a list stays a list, a number a number. Text around it makes the whole field text.
  • A missing field reads as null, not an error. Most functions refuse null: add a fallback with ?? or default, as in upper(json.name ?? "").
  • Every function is on Functions.

Common mistakes

  • Joining text and a number with +. Put the number in its own {{ }}, or use toString.
  • A date pattern from another tool. Month and weekday names (MMMM) are refused, and so are parts with nothing between them (yyyyMMdd): write yyyy-MM-dd.
  • Counting positions from 1. The first item is [0].