NameError: name not defined (even though it was defined earlier)

@stelodae6 , you have both Python and JS errors above, so perhaps something is wring with the general logic. Do you have that code nested in a conditional, where perhaps listInput is not set? Please share the code so we can see what is happening.