Instead of writing internal script code to determine the visibility or read-only properties of fields and UI panels, you can add a JavaScript expression in the Read-only or Hidden expression, in the properties for a field or UI panel.

image-20250224-113111.png

The Read-only and Hidden-expression are basic JavaScript eval expressions, that decide whether a field should be hidden or read-only. See the table below for examples. 

Info: Read-only and Hidden expressions support JavaScript notation to evaluate an expression. They support field lookup, arithmetic and logical operators.

  • Field references must be enclosed in double curly brackets, for example {{field01}}.

  • Text fields referenced in the expression must be of type Single Line.

Expression

Description

{{L301}}=="HIDE" || {{selector}}<2

Match if the L301 field value is "HIDE" and the numeric field selector is less than 2.

({{A}}+{{B}}) > 2

Match if A (which is 1) plus B (which is 2) larger than 2

{{A}}-{{B}} < 2

Match if A (which is 2) minus B (which is 1) less than 2.

{{A}}*{{B}} == 4

Match if A (which is 2) multiplied with B (which is 2) equals 4

{{A}}*0.5 == 2

Match if A (which is 4) multiplied by 0.5 (instead of “/” by 2) equals 2. The reason we use multiplication instead of divide, is that the division character is not supported in the expression.

{{$APP}}==="TemplateBuilder"{{field_checkbox}}==false

Match if the environment variable $APP equals “TemplateBuilder”, and the field called field_checkbox is false.