Possibility to Splice Array

Hello,

Right now there is no way to remove an item form array on a specific index.
It would be nice to have a JavaScript like splice method in trigger builder.

var fruits = ["Banana", "Orange", "Apple", "Mango"];
fruits.splice(0, 1);        // Removes the first element of fruits

The first parameter (0) defines the position where new elements should be added (spliced in).
The second parameter (1) defines how many elements should be removed.
The rest of the parameters are omitted. No new elements will be added.

1 Like

I agree. It might even be easier to have another collection data type like a List that’s easier to manipulate and expand/contract in-app.

1 Like

Tom and Brad, thanks for your feedback. After adding arrays to expression editor a few months ago we have been adding additional support for array manipulation functions, with more on the way.

Due to your feedback we’ll make sure that splice functionality (or a similar function that achieves the same goal) is included in our next iteration of array functions. I’ll add to this thread when I have any update on this functionality.

3 Likes

predefine Reduce() function can be nice also, for example ReduceSum, ReduceMax, ReduceAvg, …

As Tulip support HTTP Array of Objects as output, will be nice to support slice, map, splice not only for array of fields but array of objects. This can help to move from list/table/grid to selected record

1 Like