FEEL list functions

23 DMN 1.6 built-in functions + 1 engine extension

Lists are how a DMN decision deals with more than one of anything: order lines, applicants, past claims. FEEL lists are ordered, can hold values of any type including null and other lists, and are never modified. Every list function returns a new list.

This guide covers every list built-in, plus the patterns you need around them: summing a field across a list of contexts, filtering out nulls before aggregating, and when to use list contains and when in. Each result was computed by the FEEL engine behind the evaluator at the top.

All FEEL list functions at a glance

FunctionSignatureReturns
list containslist contains(list, element)Returns true if the list contains the element
countcount(list)Returns the number of elements in the list
minmin(list) or min(c1, …, cN)Returns the smallest element
maxmax(list) or max(c1, …, cN)Returns the largest element
sumsum(list) or sum(n1, …, nN)Returns the sum of the numbers
meanmean(list) or mean(n1, …, nN)Returns the arithmetic average of the numbers; null for an empty list
medianmedian(list) or median(n1, …, nN)Returns the median: the middle element of the sorted values, or the mean of the two middle elements for an even count
stddevstddev(list) or stddev(n1, …, nN)Returns the sample standard deviation of the numbers
modemode(list) or mode(n1, …, nN)Returns the most frequent value(s) as a list; ties produce several results in ascending order
sublistsublist(list, start position, length?)Returns the slice of the list starting at start position, running to the end or for length elements
appendappend(list, item…)Returns a new list with the items added to the end
concatenateconcatenate(list…)Returns one list containing the elements of all argument lists, in order
insert beforeinsert before(list, position, newItem)Returns a new list with newItem inserted before the given position
removeremove(list, position)Returns a new list with the element at the given position removed
reversereverse(list)Returns the list in reverse order
index ofindex of(list, match)Returns the positions of all occurrences of match, as an ascending list of 1-based indexes
unionunion(list…)Returns all elements of the argument lists with duplicates removed, preserving first-seen order
distinct valuesdistinct values(list)Returns the list with duplicate elements removed, preserving first-seen order
duplicate valuesduplicate values(list)Returns the values that appear more than once in the list
flattenflatten(list)Returns a flat list with all nested lists recursively expanded in place
productproduct(list) or product(n1, …, nN)Returns the product of the numbers
sortsort(list, precedes)Returns the list sorted by the precedes function
list replacelist replace(list, position | match, newItem)Returns a new list with the element at the position, or every element accepted by the matcher function, replaced by newItem
partitionpartition(list, size)Splits the list into consecutive chunks of the given size; the last chunk may be shorter

Rules every list function follows

Positions are 1-based, and negative positions count from the end. A position must exist in the list: 0 or anything beyond the length is outside the function's domain, and the result is null. The same goes for a sublist length that runs past the end of the list.

A single value counts as a one-element list. Where a function expects a list, FEEL converts a single value into a list with that one element, so count("abc") is 1 and sum(5) is 5.

Aggregates do not skip nulls. sum, mean, min, max and the others return null if any element is null. Filter the list first with [item != null].

sublist([1, 2, 3], -2)
returns [2, 3] Try it ↑

Negative start: the last two elements.

sublist([1, 2, 3], 5)
returns null Try it ↑

Out of range gives null.

sublist([1, 2, 3], 2, 10)
returns null Try it ↑

So does a length past the end.

count("abc")
returns 1 Try it ↑

A single value is treated as a one-element list.

sum([1, null, 3])
returns null Try it ↑

One null element makes the whole sum null.

sum([1, null, 3][item != null])
returns 4 Try it ↑

Filter out nulls first.

Summing and counting over a list of contexts

Decision inputs are usually lists of contexts, such as order lines with a price and a quantity. Selecting a field from a list of contexts gives the list of that field's values, so sum(lines.price) works directly. For anything more than one field, use a for expression, and add a filter to count only matching entries.

sum([{price: 2, qty: 3}, {price: 5, qty: 1}].price)
returns 7 Try it ↑

.price on a list of contexts gives the list of prices.

sum(for line in [{price: 2, qty: 3}, {price: 5, qty: 1}] return line.price * line.qty)
returns 11 Try it ↑

Line totals: price times quantity, summed.

count([{age: 17}, {age: 34}, {age: 52}][age >= 18])
returns 2 Try it ↑

Inside a filter, the fields of each context are in scope directly.

max([{age: 17}, {age: 34}, {age: 52}].age)
returns 52 Try it ↑

list contains, in and =

list contains(list, x) and the in operator both test membership, and both find a null element, because null = null is true. Neither converts types, so the string "2" is not found in a list of numbers. Numbers compare by value, so 1 and 1.0 are equal.

list contains([1, null, 3], null)
returns true Try it ↑
2 in [1, 2, 3]
returns true Try it ↑
null in [1, null, 3]
returns true Try it ↑
list contains([1, 2, 3], "2")
returns false Try it ↑

No conversion between strings and numbers.

list contains([1.0, 2], 1)
returns true Try it ↑

1 and 1.0 are the same number.

list contains([{a: 1}], {a: 1})
returns true Try it ↑

Contexts and lists compare by content.

Combining lists: append, concatenate, union, flatten

append adds its arguments as elements, so appending a list nests it. concatenate joins lists end to end. union also joins them but drops duplicates. flatten removes nesting at every depth.

append([1], [2])
returns [1, [2]] Try it ↑

The list becomes a single nested element.

concatenate([1], [2])
returns [1, 2] Try it ↑
union([1, 2], [2, 3])
returns [1, 2, 3] Try it ↑
flatten([1, [2, [3, [4]]]])
returns [1, 2, 3, 4] Try it ↑

Function reference

Each function with its parameters, examples and edge cases.

list contains(list, element)

Returns true if the list contains the element. Unlike the = operator, it can also test for null.

The element may be null, so list contains also tests whether a list has a null entry. Comparison is by value with no type conversion.

ParameterTypeDescription
listlistthe list to search
elementanythe value to look for; may be null
list contains([1, 2, 3], 2)
returns true Try it ↑
list contains([1, null, 3], null)
returns true Try it ↑
list contains([1, 2, 3], "2")
returns false Try it ↑

A string is never equal to a number.

list contains([1.0, 2], 1)
returns true Try it ↑
list contains([[1, 2], [3]], [1, 2])
returns true Try it ↑

Nested lists compare by content.

list contains([date("2026-01-01")], date("2026-01-01"))
returns true Try it ↑
list contains([], 1)
returns false Try it ↑
list contains(null, 1)
returns null Try it ↑

A null list gives null in FEEL; B-FEEL returns false.

Related: index of · count

count(list)

Returns the number of elements in the list.

ParameterTypeDescription
listlistthe list to count
count([1, 2, 3])
returns 3 Try it ↑
count([])
returns 0 Try it ↑
count([1, null])
returns 2 Try it ↑

Null elements are counted.

count([[1, 2], 3])
returns 2 Try it ↑

A nested list counts as one element.

Related: sum · list contains

min(list) or min(c1, …, cN)

Returns the smallest element. All elements must be comparable with each other (numbers, strings, or temporal values).

ParameterTypeDescription
listlistcomparable values, as one list or as separate arguments
min([1, 2, 3])
returns 1 Try it ↑
min("a", "b", "c")
returns a Try it ↑
min([])
returns null Try it ↑
min([1, "a"])
returns null Try it ↑

Mixed types cannot be compared.

Related: max · mean · median

max(list) or max(c1, …, cN)

Returns the largest element. All elements must be comparable with each other.

ParameterTypeDescription
listlistcomparable values, as one list or as separate arguments
max(1, 2, 3)
returns 3 Try it ↑
max([date("2026-01-01"), date("2026-07-24")])
returns 2026-07-24 Try it ↑
max([1, null, 3])
returns null Try it ↑

A null element cannot be compared. Filter nulls first.

max([1, null, 3][item != null])
returns 3 Try it ↑

Related: min · mean · median

sum(list) or sum(n1, …, nN)

Returns the sum of the numbers. The sum of an empty list is null.

sum takes either one list or several numbers as separate arguments. The two things that surprise people are that an empty list sums to null, not 0, and that one null element makes the whole sum null. Both matter when the list comes from a filter that can match nothing.

To sum a field across a list of contexts, select the field: sum(orders.amount). To sum a computed value, use for.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
sum([1, 2, 3])
returns 6 Try it ↑
sum([])
returns null Try it ↑
sum([1, 2][item > 5])
returns null Try it ↑

A filter that matches nothing gives an empty list, and its sum is null, not 0. B-FEEL returns 0.

sum([1, null, 3])
returns null Try it ↑
sum([1, null, 3][item != null])
returns 4 Try it ↑
sum([0.1, 0.2])
returns 0.3 Try it ↑

FEEL numbers are decimal, so there is no floating-point rounding error.

sum(for o in [{price: 2, qty: 3}, {price: 5, qty: 1}] return o.price * o.qty)
returns 11 Try it ↑
sum([duration("PT1H"), duration("PT30M")])
returns null Try it ↑

sum only adds numbers; durations give null.

Related: mean · product · count

mean(list) or mean(n1, …, nN)

Returns the arithmetic average of the numbers; null for an empty list.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
mean([1, 2, 3])
returns 2 Try it ↑
mean([])
returns null Try it ↑
mean([1, null])
returns null Try it ↑

Nulls are not skipped. B-FEEL ignores them and returns 1.

Related: median · mode · stddev · sum

median(list) or median(n1, …, nN)

Returns the median: the middle element of the sorted values, or the mean of the two middle elements for an even count.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
median(8, 2, 5, 3, 4)
returns 4 Try it ↑
median([6, 1, 2, 3])
returns 2.5 Try it ↑
median([])
returns null Try it ↑

Related: mean · mode · stddev

stddev(list) or stddev(n1, …, nN)

Returns the sample standard deviation of the numbers.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
stddev(2, 4, 7, 5)
returns 2.081665999466132735282297706979931 Try it ↑
stddev([1])
returns null Try it ↑

The sample standard deviation needs at least two values.

Related: mean · median · mode

mode(list) or mode(n1, …, nN)

Returns the most frequent value(s) as a list; ties produce several results in ascending order.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
mode(6, 3, 9, 6, 6)
returns [6] Try it ↑
mode([6, 1, 9, 6, 1])
returns [1, 6] Try it ↑
mode([])
returns [] Try it ↑

Unlike the other aggregates, an empty list gives an empty list.

Related: median · mean

sublist(list, start position, length?)

Returns the slice of the list starting at start position, running to the end or for length elements.

ParameterTypeDescription
listlistthe source list
start positionnumber1-based start; negative counts from the end
lengthnumbermaximum elements to return (optional)
sublist([4, 5, 6], 1, 2)
returns [4, 5] Try it ↑
sublist([4, 5, 6], -1)
returns [6] Try it ↑
sublist([1, 2, 3], 5)
returns null Try it ↑

A start position out of range gives null.

sublist([1, 2, 3], 0)
returns null Try it ↑

There is no position 0.

Related: append · remove

append(list, item…)

Returns a new list with the items added to the end.

ParameterTypeDescription
listlistthe source list
itemanyone or more values to add at the end
append([1], 2, 3)
returns [1, 2, 3] Try it ↑
append([1], [2])
returns [1, [2]] Try it ↑

A list argument is added as one nested element. Use concatenate to join lists.

append([1], null)
returns [1, null] Try it ↑

Null is a valid element.

Related: insert before · concatenate

concatenate(list…)

Returns one list containing the elements of all argument lists, in order.

ParameterTypeDescription
listlisttwo or more lists to join in order
concatenate([1, 2], [3])
returns [1, 2, 3] Try it ↑
concatenate([1], [2], [3])
returns [1, 2, 3] Try it ↑

Related: append · union · flatten

insert before(list, position, newItem)

Returns a new list with newItem inserted before the given position.

ParameterTypeDescription
listlistthe source list
positionnumber1-based position of the element to insert before
newItemanythe value to insert
insert before([1, 3], 1, 2)
returns [2, 1, 3] Try it ↑
insert before([1, 2], -1, 9)
returns [1, 9, 2] Try it ↑

Negative positions count from the end.

insert before([1, 2], 3, 9)
returns null Try it ↑

The position must exist, so this cannot append. Use append.

Related: append · remove

remove(list, position)

Returns a new list with the element at the given position removed.

ParameterTypeDescription
listlistthe source list
positionnumber1-based position to remove; negative counts from the end
remove([1, 2, 3], 2)
returns [1, 3] Try it ↑
remove([1, 2, 3], -1)
returns [1, 2] Try it ↑

Removes the last element.

remove([1, 2, 3], 5)
returns null Try it ↑

Related: insert before · sublist · list replace

reverse(list)

Returns the list in reverse order.

ParameterTypeDescription
listlistthe list to reverse
reverse([1, 2, 3])
returns [3, 2, 1] Try it ↑

Related: sort

index of(list, match)

Returns the positions of all occurrences of match, as an ascending list of 1-based indexes.

ParameterTypeDescription
listlistthe list to search
matchanythe value to find
index of([1, 2, 3, 2], 2)
returns [2, 4] Try it ↑
index of([1, 2], 3)
returns [] Try it ↑

No match gives an empty list, not null or 0.

Related: list contains

union(list…)

Returns all elements of the argument lists with duplicates removed, preserving first-seen order.

ParameterTypeDescription
listlisttwo or more lists
union([1, 2], [2, 3])
returns [1, 2, 3] Try it ↑

Related: distinct values · concatenate

distinct values(list)

Returns the list with duplicate elements removed, preserving first-seen order.

ParameterTypeDescription
listlistthe source list
distinct values([1, 2, 3, 2, 1])
returns [1, 2, 3] Try it ↑

Related: duplicate values · union

duplicate values(list)

Returns the values that appear more than once in the list.

ParameterTypeDescription
listlistthe source list
duplicate values([1, 2, 3, 2, 1])
returns [1, 2] Try it ↑

Related: distinct values

flatten(list)

Returns a flat list with all nested lists recursively expanded in place.

ParameterTypeDescription
listlista possibly nested list
flatten([[1, 2], [[3]], 4])
returns [1, 2, 3, 4] Try it ↑

Related: concatenate

product(list) or product(n1, …, nN)

Returns the product of the numbers.

ParameterTypeDescription
listlist of numbersnumbers, as one list or as separate arguments
product(2, 3, 4)
returns 24 Try it ↑
product([])
returns null Try it ↑
product([2, null])
returns null Try it ↑

Related: sum

sort(list, precedes)

Returns the list sorted by the precedes function.

The precedes function decides the order: it receives two elements and returns true if the first belongs before the second. To sort contexts, compare the field you want. To sort in descending order, use >.

DMN 1.6 lists both parameters without marking precedes optional. The engine behind this site also accepts sort(list) for comparable elements and sorts them ascending, but a portable model passes the function.

ParameterTypeDescription
listlistthe list to sort
precedesfunctionordering function taking two elements and returning true if the first sorts before the second
sort([3, 1, 2], function(x, y) x < y)
returns [1, 2, 3] Try it ↑
sort(["b", "a", "c"], function(x, y) x < y)
returns [a, b, c] Try it ↑
sort([3, 1, 2], function(x, y) x > y)
returns [3, 2, 1] Try it ↑

Descending.

sort([{n: "b"}, {n: "a"}], function(x, y) x.n < y.n)
returns [{n=a}, {n=b}] Try it ↑

Sort contexts by a field.

Related: reverse

list replace(list, position | match, newItem)

Returns a new list with the element at the position, or every element accepted by the matcher function, replaced by newItem.

ParameterTypeDescription
listlistthe source list
position | matchnumber or function1-based position, or a matcher function of (item, newItem)
newItemanythe replacement value
list replace([2, 4, 7, 8], 3, 6)
returns [2, 4, 6, 8] Try it ↑
list replace([2, 4, 7, 8], function(item, newItem) item > 5, 0)
returns [2, 4, 0, 0] Try it ↑

Related: remove · insert before

partition(list, size)

Not part of the DMN 1.6 standard: an extension supported by the engine behind this site. A model that uses it may not run on other DMN engines.

Splits the list into consecutive chunks of the given size; the last chunk may be shorter.

ParameterTypeDescription
listlistthe source list
sizenumbermaximum chunk size, a positive integer
partition([1, 2, 3, 4, 5], 2)
returns [[1, 2], [3, 4], [5]] Try it ↑
partition([1, 2, 3], 0)
returns null Try it ↑

The size must be positive.

Related: sublist · flatten

How B-FEEL differs

In standard FEEL an invalid argument makes the result null. The business-friendly B-FEEL dialect returns a type default instead. Both columns were evaluated by the same engine:

ExpressionFEELB-FEEL
sum([1, "2", 3])null4
index of(null, 1)null[]
sublist(null, 1)null[]

Every result on this page was computed by the Impulse FEEL engine 0.9.1, the interpreter that runs the playground. Last updated .

Defined by the OMG DMN 1.6 specification, chapter 10.3.4 (built-in functions).