ColdFusion · Exception
What does UndefinedVariableException: Variable [name] is undefined mean in ColdFusion?
A variable was referenced that has not been assigned a value in the scope it was looked up in. This is distinct from an undefined array or struct element: this fires for a plain variable name, most often from a typo, a missing scope prefix (writing myVar instead of application.myVar), or a scope like SESSION that is not available at that point in the request lifecycle.
A variable was referenced that has not been assigned a value in the scope it was looked up in. This is distinct from an undefined array or struct element: this fires for a plain variable name, most often from a typo, a missing scope prefix (writing myVar instead of application.myVar), or a scope like SESSION that is not available at that point in the request lifecycle.
Check the exact variable name and scope prefix for a typo first, since that is the most common cause. Guard genuinely optional variables with isDefined() or structKeyExists(), or set a default with cfparam rather than assuming the variable will always exist.