List from single values
Syntax
[$e1, ..., $eN]
list($e1,... $eN)
Description
Creates a fixed length list from the evaluations of the given expressions e1,... eN
. The first short form is known from JSON list notation, the second form reads better as a function call. Lists are ordered and may contain an element multiple times.
A list cannot be modified afterwards. To add new elements, for example, Concatenation can be used to create a new list.
Parameters
Name | Type | Description | Mandatory | Default |
---|---|---|---|---|
e | Number/string/boolean/Business object/set | A single value to be inserted into the list. Any number of single values can be inserted. | yes |
Return value
Type: Set
A set with the given scalar values.
Examples
List of strings
["hello", "how", "are", "you"]
Output: A list with the elements ["hello", "how", "are", "you"].
List of numbers
list(1, 2, 3, 4, 5)
Output: A list with the elements [1, 2, 3, 4, 5].
List of different data types
list(1, "hello", true, date(2021, 9, 21))
Output: A set with the elements [1, "hello", true, date(2021, 9, 21)]