ADD CONDITIONS FOR FIELD IN ZOHO BOOKS TEMPLATE CUSTOMAZATION

ADD CONDITIONS FOR FIELD IN ZOHO BOOKS TEMPLATE CUSTOMAZATION

HELLO
I WANT TO ADD CONDITIONS FOR FIELD IN ZOHO BOOKS TEMPLATE CUSTOMAZATION
FOR SALES ORDER .
I HAVE SET %StatusStamp% IF APPROVAL I WANT THAT TEXT TO BE DISPLAYED WITH GREEN COLOR
OTHERWISE OF OTHERR STATUS RED COLOR AS SHOWN IN CODE BELOW .
BUT IT SEEMS IT DOESNT WORK SINCE I TRIED MANY WAYS
SO CAN I HAVE VARIABLE FOR FIELD LINKED TO %StatusStamp%
AND IS IT GOING TO WORK TO ADD CONDITIONS ON ZOHO TEMPLATES /?
  1. THIS IS THE CODE :<td style="width: 50%;">

  2.   <font>
        <span style="color: <% if(%StatusStamp%.startsWith("a")) { %><span style="color: #FF0000;">%StatusStamp%</span><% } else { %><span style="color: #FF0000;">%StatusStamp%</span><% } %>;">
          <%=%StatusStamp% %>
        </span>
      </font>
    </td>