I have encountered a weird behavior related to insert() function. My use case is I am trying to insert 3 new values at the top of the list.
E.g. Initial list is {"W","X","Y","Z"} and I try the insert command like insert({"W","X","Y","Z"},{"A","B","C"},{1,2,3})
But this command doesn't yield the expected result and yields output as {"A", "W", "B", "X", "C", "Y", "Z"}
Again I tried like this : insert({"W","X","Y","Z"},{"A","B","C"},{1,1,1}) and output is as expected : {"A", "B", "C", "W", "X", "Y", "Z"}
Can someone help me understand why {1,1,1} worked but {1,2,3} didn't?
Thanks in advance!
Discussion posts and replies are publicly visible
Hi Harsha, In the link provided you can find the examples so that you will get to know the actual behaviour of the insert () function. docs.appian.com/.../fnc_array_insert.html
An index value less than 1 appends the value to the left-side of the array, and an indexvalue greater than the array length appends the value to the right-side of the array.
insert({10, 20, 30, 40}, {100, 200}, {1, 2})
100, 10, 200, 20, 30, 40
Thanks, ravalik