Operators

eq

{{eq value1 value2}}
Evaluates to true if value1 is equal to value2.
Arguments
Name
Description
Type
Required
value1
A static value or a variable path
String
Number
Boolean
value2
A static value or a variable path
String
Number
Boolean
Returns
Example
Template
Data
Result
{{#if (eq category "sports") }}Category is sports{{/if}}
1
{
2
"category":"sports"
3
}
Copied!
Category is sports

ne

{{ne value1 value2}}
Evaluates to true if value1 is not equal to value2.
Arguments
Name
Description
Type
Required
value1
A static value or a variable path
String
Number
Boolean
value2
A static value or a variable path
String
Number
Boolean
Returns
Example
Template
Data
Result
{{#if (ne category "sports") }}Category is not sports{{/if}}
1
{
2
"category":"sports"
3
}
Copied!
This is a sports category

gt

{{gt number1 number2}}
Evaluates to true if number1 is greater than the number2.
Arguments
Name
Description
Type
Required
number1
A static value or a variable path
Number
number2
A static value or a variable path
Number
Returns
​ (Boolean)
Example
Template
Data
Result
{{#if (gt grand_total 1500) }}Grand total is greater than 1500{{/if}}
1
{
2
"grand_total": 1600
3
}
Copied!
Grand total is greater than 1500

lt

{{lt number1 number2}}
Evaluates to true if number1 is less than number2.
Arguments
Name
Description
Type
Required
number1
A static value or a variable path
Number
number2
A static value or a variable path
Number
Returns
Example
Template
Data
Result
{{#if (lt score 50) }}Score is less than 50{{/if}}
1
{
2
"score": 25
3
}
Copied!
Score is less than 50

gte

{{gte number1 number2}}
Evaluates to true if number1 is greater than or equal to number2.
Arguments
Name
Description
Type
Required
number1
A static value or a variable path
Number
number2
A static value or a variable path
Number
Returns
Example
Template
Data
Result
{{#if (gte score 50) }}Score is greater than or equal to 50{{/if}}
1
{
2
"score": 50
3
}
Copied!
Score is greater than or equal to 50

lte

{{lte number1 number2}}
Evaluates to true if number1 is less than or equal to number2.
Arguments
Name
Description
Type
Required
number1
A static value or a variable path
Number
number2
A static value or a variable path
Number
Returns
Example
Template
Data
Result
{{#if (lte score 50) }}Score is less than or equal to 50{{/if}}
1
{
2
"score":50
3
}
Copied!
Content to display for sports

isNull

{{isNull value}}
Evaluates to true if value is null.
Arguments
Name
Description
Type
Required
value
A static value or a variable path
Any
Returns
Example
Template
Data
Result
{{#if (isNull category) }}Category is null{{/if}}
1
{
2
"category": null
3
}
Copied!
Category is null

isNotNull

{{isNotNull value}}
Evaluates to true if value is not null.
Arguments
Name
Description
Type
Required
value
A static value or a variable path
Any
Returns
Example
Template
Data
Result
{{#if (isNotNull category) }}Category is not null{{/if}}
1
{
2
"category": "sports"
3
}
Copied!
Category is

isNil

{{isNil value}}
Evaluates to true if value is null or undefined .
Arguments
Name
Description
Type
Required
value
A static value or a variable path
Any
Returns
Example
Template
Data
Result
{{#if (isNil category) }}Category is nil{{/if}}
1
{
2
"category":null
3
}
Copied!
Category is nil

isNotNil

{{isNotNil value}}
Evaluates to true if value is not null or undefined.
Arguments
Name
Description
Type
Required
value
A static value or a variable path
Any
Returns
Example
Template
Data
Result
{{#if (isNotNil category) }}Category is not nil{{/if}}
1
{
2
"category":"sports"
3
}
Copied!
Category is not nil

isIn

{{isIn value array}}
Evaluates to true if value is in array.
Arguments
Name
Description
Type
Required
value
A static value or a variable path
String
Number
Boolean
array
Array of values to check for value
String Array
Number Array
Boolean Array
Returns
Example
Template
Data
Result
{{#if (isIn "sports" categories) }}Sports is in categories{{/if}}
1
{
2
"categories":[
3
"sports",
4
"entertainment",
5
"news"
6
]
7
}
Copied!
Sports is in categories

isNotIn

{{isNotIn value array}}
Evaluates to true if value is not in array.
Arguments
Name
Description
Type
Required
value
A static value or a variable path
String
Number
Boolean
array
Array of values to check for value
String Array
Number Array
Boolean Array
Returns
Example
Template
Data
Result
{{#if (isNotIn "sports" categories)}}Sports is not in categories{{/if}}
1
{
2
"categories":[
3
"entertainment",
4
"weather",
5
"news"
6
]
7
}
Copied!
Sports is not in categories

startsWith

{{startsWith string1 string2}}
Evaluates to true if string1 starts with string2.
Arguments
Name
Description
Type
Required
string1
A static value or a variable path to check for string2
String
string2
A static value or a variable path to check for in string1
String
Returns
Example
Template
Data
Result
{{#if (startsWith movie "Bourne") }}Movie starts with Bourne{{/if}}
1
{
2
"movie":"Bourne Identity"
3
}
Copied!
Movie starts with Bourne

endsWith

{{endsWith string1 string2}}
Evaluates to true if string1 ends with string2.
Arguments
Name
Description
Type
Required
string1
A static value or a variable path to check for string2
String
string2
A static value or a variable path to check for in string1
String
Returns
Example
Template
Data
Result
{{#if (endsWith movie "Story") }}Movie ends with Story{{/if}}
1
{
2
"movie":"Toy Story"
3
}
Copied!
Movie ends with Story

contains

{{contains string1 string2}}
Evaluates to true if string1 exists in string2.
Arguments
Name
Description
Type
Required
string1
A static value or a variable path to check for string2
String
string2
A static value or a variable path to check for in string1
String
Returns
Example
Template
Data
Result
{{#if (contains movie "Bronx") }}Movie contains Bronx{{/if}}
1
{
2
"movie":"A Bronx Tale"
3
}
Copied!
Movie contains Bronx

doesNotContain

{{doesNotContain string1 string2}}
Evaluates to true if string1 does not exist in string2.
Arguments
Name
Description
Type
Required
string1
A static value or a variable path to check for string2
String
string2
A static value or a variable path to check for in string1
String
Returns
Example
Template
Data
Result
{{#if (doesNotContian movie "Batman") }}Movie does not contain Batman{{/if}}
1
{
2
"movie":"The Dark Knight"
3
}
Copied!
Movie does not contain Batman

isEmpty

{{isEmpty path}}
Evaluates to true if the value of the variable path is undefined or not included in the data set.
Arguments
Name
Description
Type
Required
path
A path to a variable to check for a value
Any
Returns
Example
Template
Data
Result
{{#if (isEmpty category )}}Category is empty{{/if}}
1
{
2
"name":"soccer"
3
}
Copied!
Category is empty

isNotEmpty

{{isNotEmpty value}}
Evaluates to true if value is undefined or not included in the data set.
Arguments
Name
Description
Type
Required
path
A path to a variable to check for a value
Any
Returns
Example
Template
Data
Result
{{#if (isNotEmpty category) }}Category is not empty{{/if}}
1
{
2
"category":"sports"
3
}
Copied!
Category is not empty

matches

{{matches string expression}}
Returns true if string matches a regular expression.
Arguments
Name
Description
Type
Required
string
A static value or a variable path to evaluate the regular expression against
String
expression
Regular expression to evaluate
String
Returns
Example
Template
Data
Result
{{#if (matches category "^spo.*") }}Category matches regular expression{{/if}}
1
{
2
"category":"sports"
3
}
Copied!
Category matches regular expression