"unlist" result - how to go from listed result to "clean"/unlisted result?

Hello!

Unsuccessfully searched for this in the forum, so here is my challenge.

Using a code block for an IF statement, I would like the result to be without a list, so that there is no index for the result. It seems that if the condition is within a list, the result from the code block will also be in a list.

In my script, the condition comes from a Object.IsNull node, and thus in a list. Is there any way to get the result without a list - so to speak?

Please see example for clarification.

Thanks in advance!

1 Like

hi,

Can you show whats your imput is? What is the aim`?
You can use negatve index:

OUT = IN[0][0:-1]

KR

Andreas

2022-05-09_11h37_31

Yes this is possible by using a[0] as input in your Code Block.
image

2 Likes

Great, thanks! I use that function to get an item at a certain index all the time in code blocks, don’t know why I did not try it this time:-)