Skip to Content
Data ConnectivityFormulas & Expressions

Formulas and Expressions

Formulas let you compute derived values from DataPool fields. Use them in data bindings, triggers, and component inputs to transform and combine data.

Syntax

Formulas use a simple expression syntax. Reference DataPool fields using their full path:

{stream.item.field}

Arithmetic

OperatorDescriptionExample
+Addition{sales.north.revenue} + {sales.south.revenue}
-Subtraction{sales.north.revenue} - {sales.north.costs}
*Multiplication{metrics.rate} * 100
/Division{sales.north.revenue} / {sales.north.target}
%Modulo{counter.value} % 10
()Grouping({a} + {b}) / 2

String Operations

FunctionDescriptionExample
concat(a, b, ...)Join stringsconcat({first_name}, " ", {last_name})
upper(s)Uppercaseupper({status})
lower(s)Lowercaselower({email})
trim(s)Remove whitespacetrim({input})
left(s, n)First n charactersleft({code}, 3)
right(s, n)Last n charactersright({code}, 4)
replace(s, find, rep)Replace substringreplace({text}, "old", "new")
length(s)String lengthlength({name})

Number Functions

FunctionDescriptionExample
round(n, d)Round to d decimal placesround({pct}, 1)
floor(n)Round downfloor({score})
ceil(n)Round upceil({score})
abs(n)Absolute valueabs({change})
min(a, b)Smaller valuemin({actual}, {target})
max(a, b)Larger valuemax({actual}, {target})
clamp(n, lo, hi)Constrain to rangeclamp({temp}, 0, 100)

Conditional

FunctionDescriptionExample
if(cond, then, else)Conditional valueif({sales} > {target}, "Above", "Below")

Formatting

FunctionDescriptionExample
format(n, pattern)Number formattingformat({revenue}, "#,##0")
formatDate(d, pattern)Date formattingformatDate({timestamp}, "dd MMM yyyy")
currency(n, code)Currency formattingcurrency({price}, "GBP")
percent(n, d)Percentage formattingpercent({ratio}, 1) outputs "85.3%"

Lookup

FunctionDescriptionExample
lookup(table, key)Lookup table referencelookup("Statuses", {status})
lookup(table, key, default)With default valuelookup("Colours", {level}, "#grey")

Examples

Percentage of target

round(({sales.north.revenue} / {sales.north.target}) * 100, 1)

Conditional status text

if({sensors.temperature} > 35, "HIGH", if({sensors.temperature} < 10, "LOW", "NORMAL"))

Formatted currency

concat(currency({sales.total}, "GBP"), " of ", currency({sales.target}, "GBP"))

Dynamic colour based on performance

if({sales.pct} >= 100, "#27ae60", if({sales.pct} >= 80, "#f39c12", "#c0392b"))

Formulas are evaluated in real time as DataPool values change. There is no manual refresh — bound elements update automatically.

Last updated on