Array functions
This article explains various array functions that can be used in formula fields.
This cheat sheet provides a quick reference guide for various array functions commonly used in data analysis and programming. Each function is accompanied by its syntax, a sample usage, and a brief description.
ARRAYSORT
The ARRAYSORT function sorts an array result from links or lookup.
Syntax
ARRAYSORT(array, ["asc" | "desc"])Sample
ARRAYSORT({LookupField}, "desc")Remark
This function sorts an array result given from links or lookup field. The 2nd parameter is the sort order, "asc" or "desc" to sort the values ascending or descending, with "asc" as the default if not provided.
ARRAYUNIQUE
The ARRAYUNIQUE function returns unique items from the given array.
Syntax
ARRAYUNIQUE(array)Sample
ARRAYUNIQUE({Field})Remark
This function removes duplicate values, leaving only unique items from the given array.
ARRAYCOMPACT
The ARRAYCOMPACT function removes null and empty from result.
Syntax
ARRAYCOMPACT(array)Sample
ARRAYCOMPACT({Field})Remark
This function removes null and empty, leaving only visible items from given array.
ARRAYSLICE
The ARRAYSLICE function takes partial array values from start to (optional) end.
Syntax
ARRAYSLICE(array, start, [end])Sample
ARRAYSLICE({Field}, 2, 3)Remark
This function takes the array value partially, from start to (optional) end. 2nd parameter is the start index. Index start at 1. 3rd parameter is the end index. In the example above it'll take array value 2 and 3, giving a total 2 items. Omitting end index will take the rest of items starting from start index. Either start or end index cannot be negative. End index need to be bigger or equal with start index. Doing so will return empty as result.