title: How to get properties of association object in Alfresco using json.ftl
body: <p>I have a type abc:appDate.  It has a property abc:dateTime an association to self ie.,</p>
  
  <pre><code>&lt;association name="abc:nextAppDate"&gt;
  &lt;title&gt;Next App Date&lt;/title&gt;
  &lt;source&gt;
      &lt;mandatory&gt;false&lt;/mandatory&gt;
      &lt;many&gt;false&lt;/many&gt;
  &lt;/source&gt;
  &lt;target&gt;
      &lt;class&gt;abc:appDate&lt;/class&gt;
      &lt;mandatory&gt;false&lt;/mandatory&gt;
      &lt;many&gt;true&lt;/many&gt;
  &lt;/target&gt;
  &lt;/association&gt;
  </code></pre>
  
  <p><strong>How to get properties of association object using json.ftl?</strong></p>
  
  <p>I was trying to get properties of association as below, but getting "Error during processing of the template 'Expression result.assocs[\"abc:nextAppDate\"] is undefined"</p>
  
  <pre><code>&lt;#macro dateFormat date&gt;${date?string("dd MMM yyyy")}&lt;/#macro&gt;
      &lt;#escape x as jsonUtils.encodeJSONString(x)&gt;
      {
          "nodeRef": "${result.nodeRef}", 
          "date": "&lt;@dateFormat result.properties["abc:dateTime"] /&gt;",
          "nextDate": [
          &lt;#list result.assocs["abc:nextAppDate"] as childKey&gt;
          {
          "date": "&lt;@dateFormat childKey.properties["abc:dateTime"] /&gt;"               
          }
          &lt;#if child_has_next&gt;,&lt;/#if&gt;
          &lt;/#list&gt;
          ]
      }
      &lt;/#escape&gt;
  </code></pre>