title: Coldfusion - How to loop through an Array of Structure and print out dynamically all KEY values?
body: <p>Giving the Array of Structure below:</p>
  
  <p><img src="https://i.stack.imgur.com/5PjwV.png" alt="enter image description here"></p>
  
  <p>I am able to print out all values from all fields by doing:</p>
  
  <pre><code>    &lt;cfset ColumnNames  = structKeyArray(ApiData[1])&gt;                       
      &lt;cfset ColumnLength = ArrayLen(ColumnNames)&gt;    
  
      &lt;cfloop from="1" to="#ArrayLen(ApiData)#" index="i"&gt;            
         &lt;cfdump var="#ApiData[i].Created#"&gt;              
         &lt;cfdump var="#ApiData[i].Name#"&gt;
                 ...and so on
  </code></pre>
  
  <p>Now I am trying to loop through all fields so that I dont have to actually write the
  name of each field. How do I do this dynamically?
  Something like:</p>
  
  <pre><code>    &lt;cfloop from="1" to="#ArrayLen(ApiData)#" index="i"&gt;    
        &lt;cfloop from="1" to="#ColumnLength#" index="i"&gt;
                &lt;!---&lt;cfdump var="#ApiData[i]." + "#ColumnNames[i]#" + "#"&gt;---&gt;
                &lt;!---&lt;cfdump var="#ApiData[i].ColumnNames[i]#"&gt;---&gt;
        &lt;/cfloop&gt;
      &lt;/cfloop&gt;
  </code></pre>
  
  <p>I am not a ColdFusion guy, just helping a buddy and the ColdFusion syntax is very different from .Net :-)</p>
  
  <p>Thank you for your help</p>