Examples

Access data from an upstream action’s event 

upstream_action.path.to.value

See more information on referencing data.

Count the number of items in an array 

SIZE(my_array)

See the full list of functions.

Multiply two numbers 

my_number * 10

See the full list of operators.

Generate a random number between 1 and 10 

RANDOM(1, 10)

Get the current date and time in yyyymmdd Format 

DATE("now", "%Y%m%d")

Get the time 24 hours ago 

DATE(DATE("now", "%s") - 24 * 60 * 60, "%Y-%m-%dT%l:%M:%S%z")

Select all the elements in an array where the key has the given value 

Input:

[
  {
    "color": "red",
    "index": "1"
  },
  {
    "color": "blue",
    "index": "2"
  },
  {
    "color": "green",
    "index": "3"
  }
]
WHERE(my_array, "index", "1")

Output:

[{"color":"red","index":"1"}]

Select all the elements in an array that regex match the string "r" 

Input:

[
  "red",
  "blue",
  "green"
]

FILTER(my_array, LAMBDA(element, MATCH(element, "r")))

Output:

["red","green"]

Get the difference between two arrays (i.e. get elements from one that are not present in the other) 

Input:

array_one = [
  "dog",
  "cat",
  "turtle",
  "dinosaur",
  "lizard",
  "chicken",
  "koala"
]
array_two = [
  "cat",
  "elephant",
  "giraffe",
  "penguin",
  "tiger",
  "koala"
]
FILTER(array_two, LAMBDA(arr_two_elem, NOT(INCLUDES(array_one, arr_two_elem))))

Output:

[
  "elephant",
  "giraffe",
  "penguin",
  "tiger"
]

Construct an array of objects from an input array 

Input:

[
  "foo@tines.com", 
  "bar@tines.com"
]
MAP_LAMBDA(email_array, LAMBDA(elem, OBJECT(\"email_address\", OBJECT(\"address\", elem))))

Output:

[
  {
    "email_address": {
      "address": "foo@tines.io"
    }
  },
  {
    "email_address": {
      "address": "bar@tines.io"
    }
  }
]
Was this helpful?