Types
The formula language has the following types, which correspond to the types in standard JSON:
Text
To enter text, you can wrap your values in either single or double quotes
# Double quotes
"this is some text"
# Single quotes
'this is also some text'There is no difference in behavior between the quote styles.
If you need to use a quote inside some text you can escape it with \
# Escaping text
"As Einstein said \"Never memorize something that you can look up.\""TRUE/FALSE
Booleans can be accessed like so, note that case is significant:
# true
TRUE
# false
FALSEFormulas does not support type coercing, ie. [] will not be coerced to FALSE. All values are truthy by default except for FALSE & NULL.
NULL
Null values are written with all caps and are falsy:
NULL
# true
IS_BLANK(NULL)Numbers
Numbers are written in simple notation.
# number
123
# decimal
123.45
# negative
-123Arrays
Usually you will interact with arrays that come from your event data, however you can also create an array either using the array function or using array literal syntax.
# creating an array using a function
ARRAY(1, 2, 3)
# [1, 2, 3]
# creating an array using array literal
[1, 2, 3]
# [1, 2, 3]
To access an item in an array, you use square brackets and numbers, the first item is at position zero:
# my_array = ["first", "second", "third"]
my_array[0]
# "first"