Skip to content

Templates

Templates allow formatting data attributes into strings. The are supported in a number of locations including Dispatch display.

Syntax is a normal string with data attributes escaped by { .. }. The attributes can be formatted with functions. Conditionals are also supported.

Functions

{value | function : parameters}
Function Name Example Result
capitalize Capitalize {user.name|capitalize} Harry
upper Upper case {user.name|upper} HARRY
date Date format {user.createdAt|date:MMM YYYY} Aug 2020
age Age in years {profile.dob|age} 25
time Format as time from seconds {120|time} 0:02:00
numeral Expressions {values.x+values.y|numeral} 10
percent As a percent {values.score|percent} 90%
timeRange Time range {13-14|timeRange} 1:00-2:00pm

Conditionals

{test ? value1 : value2}
{test ? value1 : value2 | function : parameters}

Examples

Example Result
{third, second} data 2
{user.createdAt | date:MMM YYYY} Jan 1980
{third, second |capitalize} Data 2
{ 1 is 1 ? first : second |capitalize} Data 1
{ value1 is 10 ? first : second |capitalize} Data 1
{ value2 is 'abc' ? first : second |capitalize} Data 1
{ value1 > 10 ? first : second |capitalize} Data 2
{ value3| numeral: 0% } 50%
{value3 | numeral: 0.00} 0.50
{data.values.second} data 2

Dispatch formatting

When applied to a dispatch the values are available directly by referencing with {values.metric} or simply {metric}. Additional dispatch information is available through the @ context symbol.

Attributes avaialble

  • attachmentCount
  • hasAttachment
  • userName
  • authorName
  • swimlaneName
  • trackerName
  • orgName