Custom fields checkboxes are not boolean in Zoho Books

Custom fields checkboxes are not boolean in Zoho Books

Hello all,

Today I discovered a very strange and curious thing I think it is worthy to be shared with all developers: in Zoho Books, checkboxes created as a custom field dont return a boolean value, they return true/false but as a string. 

I was trying to avoid certain sales orders when making invoices and we created a checkbox to mark those sales orders and avoid them. This is a debug code I tried:

  1. urllista = "https://books.zoho.eu/api/v3/salesorders/?organization_id=" + organizationID + "&salesorder_ids=" + salesorderID;
  2. lista = invokeurl
  3. [
  4. url :urllista
  5. type :GET
  6. connection:"xxx"
  7. ];
  8. info lista;
  9. lista_ordenes = lista.get("salesorders").toList();
  10. for each  findOrder in lista_ordenes
  11. {
  12. pedido_amazon = findOrder.get("cf_pedido_amazon");
  13. info pedido_amazon;
  14. }
  15. if(pedido_amazon != true)
  16. {
  17. info "No es Pedido de Amazon";
  18. }
The last condition was not working at all and the only way I had it working was making the condition with "true" instead of the boolean value true 

Is this a normal behaviour?  Maybe the toList() function takes off the values? Does anyone know something about this?