Insert Item to end of list at index

Another (less convoluted) OOTB approach…
AddLastAtIndex2.dyn (10.9 KB)


Design Script version of the above …

a = List.GetItemAtIndex(lst,idx);
b = List.AddItemToEnd(itm<1>,a<1>);
c = SetDifference(GetKeys(lst),idx);
d = List.GetItemAtIndex(lst,c);
e = List.Flatten({b,d},1);
f = List.Flatten({idx,c},1);
g = List.SortByKey(e,f)["sorted list"];
3 Likes