last
Returns the last element of an array, or null if the array is empty.
array(required): the source array
utlx
last(["Apple", "Banana", "Cherry"]) // "Cherry"
last([42]) // 42
last([]) // null
// Use case: get the most recent event
{
latest: last(sortBy($input.events, (e) -> e.timestamp))
}