If list is empty switch to another list


#1

As the title says, i would like to use another list if the current list is empty. I tried list is empty boolean true/false, but now i’m stuck. Thanks for your help. :slight_smile:


#2

Can you post what you have so we can help you build?


#3

Is this what you’re looking for?


#4

Sorry for the late respond :smiley: Here is a picture of what i actually want. So if the list is empty get the items of the other list. list empty


#5

Here is the problem in a different view:

list_empty_02
image uploader


#6

Empty Lists and nulls tend to cause problems with certain functions, including If.
Use python instead.

test = IN[0]
true = IN[1]
false = IN[2]
empty = []

if test == empty:
	out = true
else:
	out = false

OUT = out

Python Nodes Basics
#7

Works perfectly! Thank you :slight_smile:


#8

If I had a dollar for every time this meant I had to reformat my work or reevaluate a workflow… there are ways around it but managing nulls and empties is certainly easier in Python. The List.ReplaceEmptyLists node in the clockwork package works for this if you want to avoid Python.