We are having some difficulties creating a JSON document with an Template node using mustache. There seems to be no way to create the contact array and producing valid JSON output:
Would this solution work out for you? Probably not without modifying the object with jsonata first, so rendering it with jsonata might work out better instead
That wil loop through account.contacts and for every item in it, add the email property of each object in a string, ending with a comma. That comma in the last element of that loop is the issue as that wouldn’t be valid json