Skip to main content
Skip table of contents

Filter and Variable Reference

Variables

The following table lists all of the built-in variables available within the template engine.

Variable

Description

Example

Output

input

Type: object

The object from the data pipeline that was passed in from the previously run action.

{{ input.myCsvData }}

TEXT
ID,Name
12345,Alice Jones
23456,Bob Smith

context

Type: object

A context object that provides information about the current workflow/run.

⬇️

⬇️

context.cloudId

Type: string

The current Cloud ID.

{{ context.cloudId }}

SAMPLEIMIS

context.workflowId

Type: string

The current workflow ID.

{{ context.workflowId }}

01J3N6PPJN2C5D73K4H6KJSQ8D

context.workflowName

Type: string

The current workflow name.

{{ context.workflowName }}

My Sample Workflow

context.triggerType

Type: string

The current workflow’s trigger type. Can be one of: manual, scheduled, or webhook.

{{ context.triggerType }}

manual

context.runId

Type: string

The current run’s ID. Guaranteed to be unique across different runs.

{{ context.runId }}

01J3N6TMFCDYEA1Y4P1P47YZTT

context.startTime

Type: string (datetime)

The timestamp at which the current workflow run started executing.

{{ context.startTime }}

2024-07-25T15:06:52

item

Type: object

Only used within the Select action when you provide an input array. Used to reference the current object when iterating over the array.

{{ this.myProp }}

Sample value

today

Type: string (date)

The current UTC date (only) in ISO-8601 format.

{{ today }}

2024-07-25

now

Type: string (datetime)

The current UTC date and time in ISO-8601 format.

{{ now }}

2024-07-25T15:10:40Z

date.now

Type: datetime

The current UTC date and time, as a datetime object.

{{ date.now }}

{{ date.now | format 'dddd' }}

7/26/2024 1:37:38 PM

Friday

ulid

Type: string

Generates a new ULID.

{{ ulid }}

01J3NQGV5SRVNDGBP3393234B4

guid

Type: string

Generates a new GUID / UUIDv4.

{{ guid }}

f68b8bc7-46d7-4a5d-a12f-34fdf08fe6bc

math.random [min] [maxExclusive]

Type: int

Generates a random number between the minimum (inclusive) and maximum (exclusive) numbers specified, each time the template is evaluated.

min and max must be less than or equal to 2147483647.

{{ math.random 1 100 }}

47

Filters

The following table lists all of the functions (filters) available within the template engine.

Filter

Returns

Description

Example

Output

json

string

Converts an object to a JSON string.

{{ ['Hello', 'World'] | json }}

JSON
["Hello","World"]

jsonf

string

Converts an object to a formatted JSON string.

{{ ['Hello', 'World'] | jsonf }}

JSON
[
  "Hello",
  "World"
]

jsonp

object

Parses the string into a JSON object.

{{ '{a:"b",c:2,d:true,e:null}' | jsonp }}

JSON
{
  "a": "b",
  "c": 2,
  "d": true,
  "e": null
}

length
len
count

int

Strings: Gets the length of the string.
Arrays: Gets the count of items in the array.
Objects: Gets the count of properties in the object.

{{ 1..100 | count }}
{{ "Hello world!" | len }}

100
12

upcase

string

Converts a string to upper case.

{{ "Hello world!" | upcase }}

HELLO WORLD!

downcase

string

Converts a string to lower case.

{{ "Hello world!" | downcase }}

hello world!

capitalize

string

Capitalizes the first letter of a string.

{{ "hello" | capitalize }}

Hello

select [string]

any

Selects a property from an object with a complex name. (Properties cannot be dot-indexed if they contain special characters.)

(error) {{ input.myHttpCall.headers["Cache-Control"] }}

(tick) {{ input.myHttpCall.headers | select 'Cache-Control' }}

<error>

[ "no-cache" ]

first {count=1}

any | array

Takes the first n items, or takes only the first one if the count is omitted. Works on arrays, objects, and strings. For arrays, when count=1, returns the item by itself, otherwise returns a new array of items.

{{ 0..10 | first }}

{{ "Hello world!" | first 5 }}

0

Helloupcas

type

string

Gets the type of the input object. Will return one of: string, int, long, float, boolean, datetime, timespan, jobject, jarray, or null.

{{ 'sample' | type }}

{{ 47 | type }}

{{ ('2024-07-01' | to_date_time - date.now) | type }}

string

int

timespan

format [string]

string

Formats the input according to .NET formatting rules. Allows you to format numbers, dates, times, etc. For more information, refer to the .NET formatting overview.

{{ 105.3255555555554 | format 'C' }}

{{ date.now | format 'dddd MMMM dd, yyyy' }}

$105.33

Thursday July 25, 2024

to_string

string

Converts the input into a string. If the input is already a string, does nothing. Equivalent to calling .ToString() on the input.

{{ 0.00 | to_string }}

{{ true | to_string }}

0

True

to_int

int

Attempts to convert the input to an integer. Returns 0 if the conversion failed or the input is invalid.

{{ 1.23 | to_int }}

{{ "47" | to_int }}

{{ 'a' | to_int }}

1

47

0

to_float

float

Attempts to convert the input to a floating point number. Returns 0 if the conversion failed or the input is invalid.

{{ 1.23 | to_float }}

{{ "47.12" | to_float }}

{{ 'a' | to_float }}

1.23

47.12

0

to_date_time

datetime

Attempts to convert the input into a date/time object.

{{ '1/1' | to_date_time }}

{{ '2024-06-01' | to_date_time | format 'dddd' }}

1/1/2024 12:00:00 AM

Saturday

to_bool {fallback=false}

boolean

Attempts to convert the input to a boolean. Case-insensitive. Accepted truthy values are 1, Y, YES, TRUE. Accepted falsy values are 0, N, NO, FALSE. null is considered false. All other inputs will result in the fallback value being returned, which defaults to false.

{{ 'a' | to_bool }}

{{ 'a' | to_bool true }}

{{ 'TRUE' | to_bool }}

{{ 'Y' | to_bool }}

{{ 'N' | to_bool true }}

false

true

true

true

false

to_base64

string

Converts the input to a Base64-encoded string.

{{ 'Hello Base64!' | to_base64 }}

SGVsbG8gQmFzZTY0IQ==

from_base64

string

Converts the input from a Base64-encoded string back into a (UTF-8) string.

{{ 'SGVsbG8gQmFzZTY0IQ==' | from_base64 }}

Hello Base64!

to_base64_url

string

Converts the input to a Base64-encoded URL safe string.

{{ 'Hello Base64!' | to_base64_url }}

SGVsbG8gQmFzZTY0IQ

from_base64_url

string

Converts the input from a Base64-encoded URL-safe string back into a (UTF-8) string.

{{ 'SGVsbG8gQmFzZTY0IQ' | from_base64_url }}

Hello Base64!

keys

jarray

Retrieves a list of the keys present in an object/dictionary.

{{ context | keys }}

JSON
[
  "cloudId",
  "workflowId",
  "workflowName",
  "triggerType",
  "runId",
  "startTime"
]

isnull [default]

any

Null-coalescing function. Equivalent to IS_NULL() in SQL, or the ?? operator in C#. Returns the default value if the input object is nil or falsy.

{{ fakeVariable | isnull "fallback" }}

fallback

This list does not encompass all filters available to the Liquid language. For a full filter reference, please refer to the Liquid filter documentation.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.