Display output of a function in ZML Snippet

Display output of a function in ZML Snippet

Hi!

I have a function that counts "Yes" string occurrences from a collection of form records
  1. //Function to count "Yes" string from "ResponseField" Field in "CustomerSurvey" Form

  2. int CustomerResponse()
  3. {
  4. count = 0; //initialize variable
  5. for each  rowVar in CustomerSurvey[ResponseField.contains("Yes")] //loop
  6. {
  7. count = count + 1;
  8. }
  9. return count; 
  10. }
  11. //output: 200
I have called this function in <text> element in ZML Snippet as follows.
This snippet is used on a page in ZOHO Creator. The function and ZML Snippets resides in the same application.

  1. <% {
  2. %>
  3. <panel>
  4. .
  5. .
  6. ...
  7. <text marginLeft='0px' marginRight='20px' color='#00D9B1' size='36px' uppercase='false' underline='false' bold='true' italic='false' type='Text' bgColor='rgba(0, 0, 0, 0)' value=thisapp.CustomerResponse()
  8. .
  9. .
  10. ...
  11. </pc>
  12.   </pr>
  13. </panel>
  14. <%}%>
However I get following error on the live app.



I am new to Deluge and ZML concepts. Any suggestion to solve this are welcome.
Thanks!