Skip to main content

Functions and pipe functions

Two things can appear inside an expression besides a lookup. A function produces a value out of nothing. A pipe function transforms a value you already have.

Functions

Written on their own, with no value in front of them.

FunctionReturns
{{NewGuid}}A new GUID.
{{EmptyGuid}}The empty GUID, 00000000-0000-0000-0000-000000000000.
{{NewDateUtc(value)}}A UTC date and time. The argument is required.

NewDateUtc accepts:

ArgumentReturns
NowThe current UTC date and time.
TodayToday at midnight.
YesterdayYesterday at midnight.
FirstDayOfYear1 January of the current year, at midnight.
LastDayOfYear31 December of the current year, at midnight.
{{NewDateUtc(Now)}}
{{NewDateUtc(FirstDayOfYear)}}

Pipe functions

A pipe function goes after a value, separated by |. Some take an argument in parentheses. They chain, left to right.

{{['GetProjectFile']$.Content.Url | UrlEncode}}
{{['StartDate'] | AddDays(-1) | ToDateUtc}}

Converters

PipeEffect
ToBase64Encodes the value as Base64.
FromBase64Decodes a Base64 value.
UrlEncodeEscapes the value for use in a URL.
ToJsonParses the value into JSON.
ToJsonStringSerialises the value to a JSON string.
ToDateUtcReads the value as a UTC date and time.
FromUnixTimeSecondsConverts a Unix timestamp in seconds to a date.
FromUnixTimeMilliSecondsConverts a Unix timestamp in milliseconds to a date.
{{['CreateCsv']$ | ToBase64}}
{{['GetProjectFile']$.Content | ToJsonString}}

Strings

PipeEffect
TrimRemoves surrounding whitespace.
ToLowerCaseLowercases the value.
ToUpperCaseUppercases the value.
ToLowerCamelCaseConverts the value to lowerCamelCase.
ToUpperCamelCaseConverts the value to UpperCamelCase.
RemoveLeading('value')Removes value from the start.
RemoveTrailing('value')Removes value from the end.
Join('value')Appends value, or joins an array with it as separator.
Split('value')Splits on value.
{{['MyText'] | RemoveLeading('DRAFT-') | Trim}}
{{['Codes']$ | Join(',')}}

Tests

PipeEffect
IsNullOrEmptyTrue when the value is null or empty.
Contains('value')True when the value contains value.

These are what a Case action's test is usually built from.

Arithmetic

PipeEffect
AddDecimal(value)Adds value to a number.
SumSums an array.
MinSmallest value in an array.
MaxLargest value in an array.
AvgMean of an array.
{{['ArrayOfValues']$ | Sum}}

Dates

PipeEffect
AddMonths(value)Shifts a date by whole months.
AddDays(value)Shifts a date by whole days.
AddHours(value)Shifts a date by hours.
AddMinutes(value)Shifts a date by minutes.

Negative arguments move backwards.

{{NewDateUtc(Today) | AddDays(-1)}}