Hoping someone can give me an idea of what I'm doing wrong.
I'm looping over an array and outputting the values....simply enough. However if a field is empty I get an Element <VARIABLE> is undefined in <INDEX>.
E.g.
<cfloop array="#allocationDetails.offerings#" index="myIndex">
#myIndex.name#
#myIndex.number#
#myIndex.somefield#
</cfloop>
This works fine until a field has no value. E.g myIndex.somefield is empty then I get the error:
"Element somefield is undefined in myIndex"
If I wrap the field output in checks like isDefined("myIndex.somefield") or structKeyExists(myIndex,"somefield") etc, they return true but then I get the error "Element somefield is undefined in myIndex" when I try to output the field value.
I also tried cfdump on the myIndex.somefield and get the same error.
I would have thought this was a pretty basic thing to do but I can't see why this is getting an error. Am I missing something really obvious?
Thanks for your help.
Cheers Mark
#myIndex#(notmyIndex.somefield). Is it a structure and what keys does it contain? - Leigh