Insert empty lists not working

hello,
I am trying to insert empty lists at indicies but its not working. I have this set up so that I may have multiple sublists get returned. However, some times those sublists need to be returned as empty lists so that my list formating is correct going into my custom replace items at index node. However i cant get it to do this. in this case I simply want to return this
0 Empty List
1 Empty List
2 Empty List
3 List
0 T

How do I do that exactly? what am I doing wrong?
Thanks!

@mix

Something like that?

image

Hello salvatoredragotta, Thank you for your reply!

However, no, it wont work like that. It needs to be parametric wherever the empty list shows up in the original list, I need to take those indices of all those random indices, and at a later step, I need to be able to place an empty list at those random indices. But the indices will change with every single run of the script. So the List.Join node wont work. Does that make sense?

1 Like

Doesn’t quite make sense to me.

Every time you have an empty list you want to next an empty list inside of it?

Hello JacobSmall, Thanks for you reply!
I have a list of 4 sublists of boolean values. In those lists I first extract all the ones and assign a letter value based on which list had the “ones”. Each Sublist is of a variable length. But all the instances of each one, needs to be replaced with the appropriat letter value. The problem occurs when some of the sublists dont have any 1’s and therefore return an empty list. Because when I try to use my custom node to replace them with the correct letter value, the list and letter values get out of order. So I guess what i really need is a node that can replace instances of 1’s based on which numberical sublist the 1 is found in. I am trying, and think I am moving in the right direction. But I am open to suggestions if there is another way to do it. Thanks!

…Also all the 0’s need to be replaced with a different letter value. In this case “N”.

The new List.IndexOf|DanEDU node finds the parent and child lists of whatever you are searching for, and the corresponding List.ReplaceItemAtIndex|DanEDU is good to replace them with that format of index, however only for one value for one value. I am trying to do it for different values for each location.

A==1?
“T”:
A==0?
“N”:
null;

Edit: hit return by accident so I could see what you posted.

After you do whatever you want with your N’s and Ts you can replace the null with something else, or remove it entirely. If you’re looking to do string manipulations, you could even just use an empty string: “”.

isnt that essentially the same as this? Except I need more that one value for “A” according to your syntax

A isn’t quoted. It’s a variable input.

You appear to be doing some extra list mapping for a reason which isn’t clear to me right away. I think we need the big picture here. Post your rvt file and current dyn, or an rvt and dyn to replicate your situation and all the subtle ‘oh and this is an issue too’ bits.

1 Like

Well my VM is down right now so I cant send it to you, but what I am illustrating is what needs to happen. Hopefully this explains the difference

The one needs to be “B” is because it is in the second sublist. (index of 1)

Any luck on the upload? I’m still lost by what you’re after.

I ended up breaking the code down to each individual out come. (the circle on the left) and then I found this code on another post to replace empty lists on this forum (the circle on the right), because the clockwork ReplaceEmptyLists node doesnt work (i can never get that one to work). But this code actually seems to work. I expanded all of my lists so you can see what I was trying to accomplish if you’re curious.