Skip to content
Docs

Workflows

Functions

Change a value before you use it – round a number, change capitals, split text or read the date.

Both text and expression fields can use these functions, written with _. in front:

FunctionWhat it doesExample
_.upper, _.lowerChange to capitals or small letters_.upper(postcode)
_.lenCount the items in a list, or the characters in text_.len(rows) > 0
_.as_int, _.as_float, _.as_strTurn a value into a whole number, a decimal or text_.as_int(quantity)
_.round_numRound a number_.round_num(total, 2)
_.fmtFormat a number, such as with two decimal places_.fmt("%.2f", total) gives 42.50
_.replaceReplace part of some text_.replace(phone, " ", "")
_.split, _.joinSplit text into a list, or join a list into text_.join(", ", names)
_.getRead a value by its path – a path that doesn’t exist is an error_.get(order, "items[0].name")
_.json_parse, _.json_stringifyTurn JSON text into a value, or a value into JSON text_.json_parse(raw)
_.nowThe current date and time as text, in a timezone and format you choose_.now("Europe/London", "%d %b %Y")
_.random_choice, _.random_numPick at random_.random_choice(["Hi", "Hello"])

In text, put a function inside the curly brackets – {_.upper(name)} – or after the value as a filter – {name|upper}. See Logic in text.

Stuck? Ask Advisor in the Proto dashboard, or contact us.

© Proto