list replace

FEEL built-in function · List functions

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.

Parameters

ParameterTypeDescription
listlistthe source list
position | matchnumber or function1-based position, or a matcher function of (item, newItem)
newItemanythe replacement value

Examples

list replace([2, 4, 7, 8], 3, 6)
[2, 4, 6, 8] Try it →
list replace([2, 4, 7, 8], function(item, newItem) item > 5, 0)
[2, 4, 0, 0] Try it →

Related functions

remove · insert before

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