Expression language
Conditional expression language in Eximee allows defining conditional logic (e.g., visibility, enabled state, requiredness of fields) using JavaScript syntax extended with specific methods. Conditions are written as expressions that the platform Eximee evaluates during application runtime. Below the syntax, available methods and attributes, as well as tools that help create and test conditions, are described.
Conditional expressions in Eximee
JavaScript in conditions: All conditions in the application template can be described using JavaScript expressions. This means that in the condition field we can use standard operators (
==,!=,>,<,&&,||,!) and JavaScript functions. The syntax allows defining, among other things, negation (!condition), conjunction (condition1 && condition2) and disjunction of conditions (condition1 || condition2).Access to component values: To retrieve current field values you should use the function
getValue("COMPONENT_ID"), where COMPONENT_ID is the identifier of a field, session variable or component in the form. For example, callinggetValue("TextField1")will return the current text entered in the text field with ID = TextField1.Access to other attributes: Besides the value, components also have other properties that can be referenced. This is done using the function
getData("COMPONENT_ID", "ATTRIBUTE"), which returns the value of the specified component attribute. For examplegetData("Checkbox1", "visible")will return information about the visibility of the field Checkbox1 (similarly to usingisVisible("Checkbox1")). The list of available attributes for particular component types is presented in the component documentation and partially discussed in the later section.Data types in conditions: All values retrieved from fields are treated as text (strings) when the condition is evaluated. Therefore, for numeric or logical comparisons you should convert data types yourself. You can use standard JavaScript functions such as
parseInt()(conversion to integer) orparseFloat()(conversion to floating-point number). For boolean values remember that the string"true"/"false"should be compared as a string or converted to the boolean type.Constants: Expressions may use text constants (enclosed in quotes), numeric constants (written directly) and boolean constants (
true/falsewithout quotes).Session variables in conditions: If you want to use a session variable (global for the application) in a condition, you can reference it via
getValue("VARIABLE_NAME"). In some cases (e.g., inside complex components) you should prefix the variable name with the character@. For example, the expressiongetValue("@variable1")=="Y"will check whether the session variablevariable1has the value "Y". Note: Predefined system variables (if present) may not require this prefix. However, it is recommended to use@before names of custom variables in complex contexts to avoid ambiguity.Complex conditions and dependencies: You can build complex expressions by combining several comparisons with logical operators. For example the expression
getValue("Field1") != "" && parseInt(getValue("Field2")) > 100.The expression will returntrueonly if Field1 is not empty and at the same time the numeric value Field2 is greater than 100. When defining conditions that depend on values of other fields, remember to define listening – more on this topic later (the ).
Component attributes
Each form component has a set of standard attributes describing its state. The most important common attributes are:
value– current internal value of the component (e.g., text entered in a field, checkbox selection, selected list option).displayValue– the value shown to the user. It often matchesvalue, but for some fields it may differ (e.g., in a Comboboxvaluethis is the code/ID of the selected option, anddisplayValueis the label text).visible– information about the component's visibility ("true"or"false"). In conditions you can also use the functionisVisible("ID")which serves a similar role.enabled– information about the component's activity (editability); it takes the value"true"when the field is active or"false"when it is disabled (not editable). This attribute determines whether the user can interact with the given field.
Other attributes can be specific to the component type. For example, a dropdown component (Combobox) provides attributes Each component should have a label ( (selected option text), description (additional description) or size (number of available options). The Statements component has a collection of items statementsItemControl representing individual statements. A detailed list of attributes is found in the documentation for each component type.
Text field
value displayValue visible
Text area
value displayValue visible
Date
value displayValue visible
Date range
value displayValue visible
Plus minus
value displayValue visible
Formatted content (and collapsible)
value displayValue visible
check alt values on the application
label - text of the selected value description - description of the selected value size - length of the list of values
Account selection
value displayValue visible
Checkbox
moreInfoButtonClicked value displayValue visible
Radio
value displayValue visible
Radio group
value displayValue visible
Tile group
content - will return displayValue value displayValue visible
Tile
visible
Statements
statementsItemControl value displayValue visible
Slider
sliderValue value - (defaultValue) displayValue visible
Step Slider
sliderValue - value value - (defaultValue) displayValue visible
Double range slider
value displayValue visible
Section
folded
Checkbox section
value displayValue visible
Repeatable section
folded
Contextual help
value displayValue visible
Product selection
variantId productId value displayValue visible
Picture card
value displayValue visible
Attachments
totalFilesSize fileNames externalIds value displayValue visible
Data confirmation component
wasEdited value displayValue visible
QR code scanner
value displayValue visible
Map
value displayValue visible
Specialized component
value displayValue visible
Frontend component
value displayValue visible
Referencing attributes in conditions: As mentioned, to read an attribute use getData(id, "attribute"). However, in practice most conditions simply check the field value (value) or its visibility/enabled state. For convenience, the Eximee platform provides dedicated API methods:
getValue("ID")– returns thevalueof the component with the specified ID (most commonly used).isVisible("ID")– returns information about the component's visibility (string"true"/"false").
(Some special components have additional methods, e.g., for handling statement groups – described later.)
field If the text field EmailAddress has the identifier
GesTextField5, then:
getValue("GesTextField5")will return the entered email address,
isVisible("GesTextField5")will return"true"if the field is visible or"false"if it has been hidden.
Special attributes – Statement component: For components of type Statements (list of consents/acceptances) there are functions available to check whether a specific statement has been checked. The method getStatementValue("COMPONENT_ID", "STATEMENT_MID") returns the value of a given statement (consent) on that component. In newer versions this function may be available under the name getStatementItem. Usage is as follows: e.g. getStatementValue("Consents1", "newsletter") == "true" will return true, if in the component with ID Consents1, the statement with identifier (MID) newsletter is accepted by the user.
Advanced condition editor
Eximee Designer provides an advanced condition editorthat facilitates creating, editing and validating conditional expressions. This editor is equipped with the following features:
Syntax highlighting: JavaScript expression syntax is color-highlighted, which improves readability of complex conditions.
Automatic suggestions: while editing a condition suggestions of available variables and form fields, as well as Eximee API elements and commonly used JS methods, are displayed.
Support for the "
js:": prefix – there is no need to manually type the"js:"prefix before the condition – the editor hides it in the view and automatically adds it to the source code when saving the condition. This way the user types only the actual expression and the platform ensures the correct format.
Where the condition editor is used: The advanced editor is used in fields in the component properties such as: visibility condition, editability (enabled) condition and requiredness condition. These three properties of each form component use the described editor and allow entering a formula that respectively determines whether the component is visible, active (unlocked), and required to fill.

Syntax hints in the editor: In condition edit mode you can use hints by pressing the keys Ctrl + Space. This will display a list of available elements to use. Among the suggestions are, among others:
Standard JavaScript functions and properties:
parseInt(),parseFloat(), the property.length(text length) orsize(list size), as well as other commonly used constructs (e.g., the keywordemptyto check for empty values).Eximee API: functions provided by the platform, such as
getValue(),getData(),isVisible()orgetStatementValue(), will appear in the suggestion list, reminding about their availability.Field and variable identifiers: the editor automatically suggests component MIDs available in the form (along with their technical ID in parentheses) and the names of session variables used in the application. This allows quickly inserting a reference to a specific field without needing to remember its exact identifier.

Tip: In case of a large number of fields, to quickly find a suggestion for a specific component in the list, start typing its name (MID) – the list will be filtered. Suggestions help avoid typos in IDs and allow discovering available functions.
Examples of using conditional expressions
Below are several example conditional expressions with descriptions of their behavior. Each example shows the code fragment used in the condition definition and an explanation:
parseInt(getValue("GesTextField3")) > 5– integer comparison: checks whether the numeric value entered in the text field
GesTextField3is greater than 5.parseFloat(getValue("GesTextField5")) < 200.001– floating-point comparison: checks whether the value from the text field
GesTextField5(e.g., an amount or a number with decimal places) is less than 200.001.getValue("GesCheckbox1") == "true"– logical comparison (equality): checks whether a field of type Checkbox with ID
GesCheckbox1is checked (has the value"true").getValue("GesCheckbox1") != "true"– logical comparison (inequality): checks whether the same checkbox no is checked (i.e., has a value different from
"true"– in practice"false"or no value).getValue("GesRadioGroup1") == "audi"– text comparison: checks whether in the Radio group with ID
GesRadioGroup1the option with value"audi"(e.g., one of car brands) was selected.!!getValue("nazwiskoZew")– double negation: checks whether a given value is not empty. Two exclamation marks convert the value to boolean – the expression will return
true, if the variable or fieldnazwiskoZewhas a non-empty value (e.g., the user entered a surname), andfalseotherwise.!getValue("nazwiskoZew")– negation: checks whether the value is empty. It will return
true, if the field/variablenazwiskoZewhas no value (e.g., the user entered nothing), which in JavaScript is equivalent to a falsy value (e.g., an empty string"").getStatementItem("GesStatementPopup1", "oswiadczenie1") == "true"– condition for a Statementstype component: checks whether in the component with ID
GesStatementPopup1the statement with identifier (MID)oswiadczenie1is checked (i.e., whether the user accepted that statement).getStatementItem("@GesStatementFlat5", "zdrowotne") == "false"– similar condition for Statements inside a complex component: checks whether the statement
zdrowotnein the component with IDGesStatementFlat5(embedded in a complex component, hence the prefix@) was not checked by the user.!!!(getValue("@GesTextField13") || getValue("@GesTextField8"))– an example of a requiredness condition: the triple negation before the parenthesized expression checks whether both text fields
GesTextField13andGesTextField8are empty. Inside the parentheses the operator||returns the first non-empty value (or an empty one if both values are empty). Applying!inverts the result, and!!converts it to boolean. The overall effect istrueonly if both fields are empty (then, for example, another field becomes required). When any field has a value, the expression will returnfalse(i.e., the requiredness condition is not met, so e.g., a given field does not have to be required).getValue("@GesCombobox1") != 2 && getValue("@GesCombobox1") > 0– a compound condition for a selection list (Combobox): checks two things at once – whether the value selected in the Combobox field
GesCombobox1is not equal to 2 and whether it is greater than 0. Such a condition could be used, for example, to verify a selection other than the default (assuming that the value0means no selection, and2is some excluded option).isVisible("@GesTextField1") == "true"– visibility state check: the condition will return
true, if the component with IDGesTextField1is currently visible (e.g., another condition did not hide it). This can be used to make behavior dependent on whether another field is on the screen.getValue("GesTextField5").length == 10– text length check: the condition returns
true, if exactly 10 characters were entered in the text fieldGesTextField5. This can be used, for example, to validate format (check whether a number has the required length).
(The above examples use sample identifiers generated by the system, such as GesTextField5. In a real project it is recommended to give fields readable business identifiers (MIDs), which makes referencing them in conditions easier later)
Conditional expressions in complex and business components
Inside a complex/business component, to unambiguously indicate a variable/field from that component, prefix the name with the character
@:getValue("@variableName")field
getValue("@defaultCurrency") == "USD".Why? during condition evaluation
@expands to the component identifier, e.g.getValue("@variableName")GesCheckbox11.ariaLabelgetValue("GesComplexComponent1.variableName"), which eliminates name collisions with the main form where the component was placed.
When there is a name collision (the same variable/field in the main application and in the component) or you want to be precise — use
@even if the condition works without it.Good practice: in complex/business components always prefix variable/field names with the character
@in conditional expressions, unless you intentionally want to reference a variable/field from the main form - then omit@Note: variables predefined by the system are placed on the main form, so we reference them directly by name omitting the character
@.
Examples:
Main form:
getValue("defaultCurrency") == "USD".Inside the component (precisely to the variable from that component):
getValue("@defaultCurrency") == "USD".
FAQ – Frequently Asked Questions
How do I set a component to display conditionally (e.g., after checking a checkbox)?
You should use the property Visibility condition (visibleCondition) available in the component's properties panel. In the condition field we enter an expression that should return true when the component should be visible. For example: if the field AdditionalSection should appear after checking the checkbox ShowSection (id=GesCheckbox7), then set the visibility condition: getValue("GesCheckbox7") == "true". When the user checks that checkbox, the condition will be met and AdditionalSection will become visible.
The condition does not refresh after changing another field – what am I doing wrong? Most likely the listeningsetting is missing. For a component to react to changes of another field used in the expression, you must set its ListeningOn attribute (Listening) pointing to that field. In other words, the component with the condition must "listen" to the component on which the condition depends. In Eximee Designer you do this in the Interactions component properties section – add the dependent field's identifier to the Listening list. After correctly setting listening, changing the value of one field will automatically cause re-evaluation of the condition in the other field.
How to check in a condition whether a field is empty or filled?
There are several ways to do this. The simplest is to use the fact that an empty string in JavaScript is a falsy (falsy) value. For example: the expression !getValue("FieldX") will return true, when FieldX is empty (negating an empty string yields true). Conversely, the expression !!getValue("FieldX") will return true, only if FieldX has some value (double negation converts the value to boolean preserving its "truthiness"). Alternatively you can compare directly to the empty string: getValue("FieldX") == "" (empty) or getValue("FieldX") != "" (filled).
Do I have to add the prefix js:?
to the conditional expression? "js:" No. In the Eximee Designer editor we type only the conditional expression itself, without any prefixes. The prefix is added automatically in the source code and is used internally to mark that the condition should be interpreted as a JavaScript script. If you inspect the XML configuration of the application, you will seecondition="js:...your_expression..."
, but in the Designer interface you do not need (and should not) write this manually.
How to define a condition that is always met (always true)? If you want an action/condition to be always truetrue (e.g., so that an element is always visible or some action always occurs), you can enter a true constant as the expression. In practice it is enough to enter the value . The editor will add the appropriate prefix and the condition will be treated as always met. Alternatively, you can enter js:true false in the raw configuration – the effect will be the same. Similarly, an always-false condition can be obtained by entering
(which will cause, for example, that a given component will never be visible on its own).
Can I use arbitrary JavaScript functions in conditions? Basic JavaScript functions and operators are supported, especially those suggested by the editor (like, parseIntparseFloat getValue, getData, etc.) for consistency and performance. Direct references to DOM elements or global variables are not supported and may cause errors. If you need complex logic, consider placing it in a validator code or service.
Last updated
Was this helpful?
