Level.Name not returning a value so trying togo around it

Evening all,
i have a list from where i want to gather the Level.Name, unfortunately some elements return an empty value.
I would like to avoid the error so basically replace the empty index with something like “not available” while the other returns the level name… while not returning an error.
image

Like this?

@Daniel_Hurtubise - can you post the preview of the node feeding into that and a preview of where you are selecting your levels? I can’t envision a situation where this would return anything other than the level name.

If you want to clear out empty strings you can also avoid the python and get around the solution with a variation of this in a code block:

A==“”?
“No Level”:
A;

This seem to be working with String but passing on a list of elements wont add the string to the list.
Is it because the lsit needs to stay the same object type?

Morning @JacobSmall. They are not string, they are Levels from which i want to get the LevelName

l6 = l0.GetParameterValueByName(“Level”);
l7 = l6.Name;

@Daniel_Hurtubise - do your selected elements not have a level parameter?

They are all the same families (generic modesl)

Think I’d need a rvt to find out why this is happening, and how to resolve it.

Here’s the Object Type output

Try this script:

may be something like this?

At least this time i get null instead of an empty index :slight_smile:![image|663x444]
From there i can replace the nulls but it would be nice if the python node could do it

(upload://gknIZgpJk4Pk0Z0LyW5mC1qQDzl.png)

This last script i wrote will replace all items that do not have “Level” in the name. So it will work with both the blank items and the nulls.