List.ReplaceItemAtIndex not working with multiple items in a sublist

Hello wizards, I am in need of some input. I am trying to use ReplaceItemAtIndex node and it keeps failing. I have tried changing lacing options and no matter what it does not work properly. Is there something special i need to do when the list with the Replace Items has multiple values?

Something looks off to me, you have list of 58 indexs you want to replace in a list of 322 items with items from a list of 124 items.

I mean im by no means a guru but something look off to me.

Maybe explain thale workflow as a whole more could help bring context to the solution?

Overall there is a list of 322 items. I am replacing items within that list from the list of 58 indexes. All the starting lists are the same length of 322. My issue is at those 58 indexes I cannot replace the items with the replace node. It only replaces the first index which is at index 0.

But you are trying to replace 58 indexs with a list of 128 items, i dont think that is correct.

Hi @dweber12 ,

Use the clockwork alternative instead, the ootb doesnt work with multiple indices

@Daan i made the attempt at that one too. That’s the empty node above the ootb one in the image. Neither seem to work and that’s where I was lost as to if I was missing something. Is it a lacing issue? A list level issue?

Hi @dweber12 ,

I looked into your screenshots a bit better and I now understand why the others are confused. Could you share what ALL the inputs are and what kind of output you would expect?

Also, you have a list with sublists containing 2 items, where are those 200-299 ranged numbers coming from? Does each sublist have over 300 items?

Hello @Daan here is image from where the data i am using starts to where the data i am trying to replace is. All original lists have same length at ListLevel@2. I am simply trying to replace items at indexes at ListLevel@2 which looked like it worked but only for the ) index as shown in the failing node.

You need to zoom into a node and press the camera button on the top right so we can read the information.

Sorry, it looked okay on my end. Here is a more zoomed in version.

Hi @dweber12 ,

I think you’ve made it very difficult for yourself with all these (in my opinion) unncessary list levels. I’ve flattened the inputs to make it easier. Afterwards you can normalise it, such that the original structure is kept.


2024-01-14 Replace Sublists with other Sublists and keep structure.dyn (15.8 KB)

Let me know if this works for you :slight_smile: