For the complete documentation index, see llms.txt. This page is also available as Markdown.

Expression language for defining conditions (conditions with getValue)

Condition writing editor

Advanced condition editor

Conditions in JavaScript format

It is possible to describe all conditions defined in the application template using expressions in the language JavaScript.

JS conditions provide the methods:

  • getValue("COMPONENT_ID") - recommended way to return a component value (any other may cause performance issues)

  • getData("COMPONENT_ID","COMPONENT_ATTRIBUTE") - returns the value of the specified component attribute; available attributes can be found here Component attributes

  • isVisible("ID_KOMPONENTU") - a way to check whether a component is visible (listening required; you cannot get the visibility of a radio button or the visibility of elements inside a repeating section from outside the repeating section)

  • getStatementValue("COMPONENT_ID", "STATEMENT_MID") - allows returning the value of the selected statement for the Statements component.

All field values available during condition evaluation are text values, therefore operations on numbers or boolean types require explicit conversion.

Examples of conditions in the format JavaScript:

// integer comparison of a TextField type field
parseInt(getValue("GesTextField3"))>5
  
// floating-point comparison of a TextField type field
parseFloat(getValue("GesTextField5"))<200.001
  
// comparison of a logical value (equal) of a CheckBox type field
getValue("GesCheckbox1")=="true"
 
// comparison of a logical value (different) of a CheckBox type field
getValue("GesCheckbox1")!="true"
 
// comparison of a text value of a RadioGroup type field
getValue("GesRadioGroup1")=="audi"
  
// checking whether the value, e.g. a session variable, is not empty
!!getValue("nazwiskoZew")
  
// checking whether the value, e.g. a session variable, is empty
!getValue("nazwiskoZew")
  
// check whether the statement with MID oswiadczenie1 in the component with id GesStatementPopup1 has been accepted
getStatementItem("GesStatementPopup1","oswiadczenie1") == "true"
  
// check whether the statement with MID health in the component with id GesStatementFlat5 (located in a composite component) has been accepted
getStatementItem("@GesStatementFlat5","zdrowotne")=="false"
 
 
// required condition for a field if the others are empty
!!!(getValue("@GesTextField13")||getValue("@GesTextField8"))
 
 
// checking combobox values
getValue("@GesCombobox1")!=2&&getValue("@GesCombobox1")>0
 
 
// check whether TextField is visible
isVisible("@GesTextField1")=="true"
 
 
// check whether the number of characters in TextField is 10
getValue("GesTextField5").length==10

Identifiers (id) of all fields available in the application template can be used in conditions.

The syntax allows defining:

  • negation of an expression using the "!" operator at the beginning of the expression

  • conjunction of expressions with the "&&" operator, e.g. getValue("@GesCombobox1")==1&&getValue("@GesCombobox1")==2

  • disjunction of expressions with the "||" operator, e.g. getValue("@GesCombobox1")==1||getValue("@GesCombobox1")==2

The following types can be used in expressions:

  • constant values

    • text

    • numeric

    • binary - true and false

  • component identifiers, e.g. GesTextField1

  • application variable identifiers, e.g. partner.

Last updated

Was this helpful?