Need help with html script

Dear Experts please help me with this

I do have a field named unit , and it is a selection field with three options ( Mpa , Psi and Kg/cm²) and if i use the below command nothing gets displayed , where i am going wrong ?

<div  class="col-xs-1"; style="width: 25%;text-align:left; padding-left: 0;height: 40px ;"><big><b><script>
{ if (doc.unit=="Mpa") 
{
    "Mpa";
} else if (doc.unit=="Psi") {
   "Psi";
} else {
    "Kg/cm²";
}
}</script></b></big></div>

Is this a print format?

Edit: If yes, you need to use Python / Jinja templating (web-search it)

1 Like

Thanks a lot sir , used Jinja template and its working .

{% if (doc.unit =="Mpa") %}
    Mpa
{% elif (doc.unit =="Psi") %}
    Psi
{% else %}
    Kg/cm²
{% endif %}

Thank you for your continued support.

1 Like