FEEL

insert before

FEEL built-in function · FEEL list functions

insert before(list, position, newItem)

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

Parameters

ParameterTypeDescription
listlistthe source list
positionnumber1-based position of the element to insert before
newItemanythe value to insert

Examples

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

Edge cases and null handling

insert before([1, 2], -1, 9)
[1, 9, 2] Try it ↑

Negative positions count from the end.

insert before([1, 2], 3, 9)

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

Related functions

append · remove

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