--- title: "Calculation expression" slug: "core-raw-parser" updated: 2026-05-12T07:59:24Z published: 2026-05-12T08:56:35Z canonical: "docs.lobstersoftware.com/core-raw-parser" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.lobstersoftware.com/llms.txt > Use this file to discover all available pages before exploring further. # Calculation expression So-called calculation expressions can be configured at some points in the client, for example to calculate label texts or other values dynamically. The configurator is provided with a predefined [Syntax](?c1753032354612#src-137313502_id-.Berechnungsausdruckv4.11.0-syntax) for this purpose, which enables predefined functions to be called or constants to be integrated, among other things. **Tip:** The $calc() function can be used to perform any calculations such as multiplication, addition, etc. This observes basic arithmetic rules such as "decimal point before dash" and bracketing and offers standard mathematical functions such as square root, sine, modulo, etc. As a rule, values which can also be evaluated as a calculation expression are offered for configuration as a special component, which appears as follows. ![images/download/attachments/137313502/image-2023-8-9_16-31-37-version-1-modificationdate-1691591481245-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-8-9_16-31-37-version-1-modificationdate-1691591481245-api-v2.png) **(1)** A text field for entering the calculation expression. **(2)** Via the "Add" ![images/s/-95e2zf/9012/8yg2g7/_/images/icons/emoticons/add.svg](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/add(33).svg) button, available constants and functions can be selected. When clicked, a menu for selecting the blocks appears. (Note: The same selection menu also appears as a context menu of the text field or when "CTRL/CMD + space bar" is pressed.) ![images/download/attachments/137313502/09-08-_2023_16-36-54-version-1-modificationdate-1691591872254-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/09-08-_2023_16-36-54-version-1-modificationdate-1691591872254-api-v2.png) The available expressions **(B)** are divided into logical groups **(A)** for clarity. The parameters of the functions and their call syntax are displayed directly. Parameters in square brackets are optional. Selecting an entry **(B)** inserts it into the text field at the position where the cursor was last positioned. **(3)** With the "check" ✔ button, the syntax of the expression can be checked for accuracy. The dialog that appears also indicates whether the expression can be displayed in "new uniform notation". The user can also decide whether the syntax valid before version 4.4.0 should be replaced by the new standard (recommended). **(4)** Opens a graphical editor for visual editing of the expression. The graphical editor also offers help on functions and parameters. **(5)** Offers the possibility to include the value of a form element in the expression. **NOTE:** This is only possible if the calculation is evaluated in the context of a form. ## Syntax In general, the syntax of calculation expressions provides that content to be evaluated as an expression is written in curly brackets "{expression}". If the brackets were omitted, the word "expression" would be returned unchecked as text. e.g. "{id}" or "{value.textValue}". Function calls or constants are also automatically interpreted as expressions (starting with $):*$funktionsname( )$konstantenname* For example, "Value*: $konstante"* results in the output "Value*: VALUE_OF_CONSTANTS"* and thus "*$constant"* results in the output "*VALUE_OF_CONSTANTS"* with leading blank characters. **NOTE:** This agreement also applies recursively to the individual parameters of functions. **Examples:** | Syntax | Explanation | | --- | --- | | $functionsname(Parameter) | The function "f" passes the word "parameter" as the parameter. | | $functionsname($constant) | The function "f" passes the value of the constant as the parameter. | | $functionsname({Parameter}) | "Parameter" is evaluated as a data field of the input object and its read value is passed to the function "f" as the parameter. | **CAUTION****:** As mentioned above, parameters are evaluated recursively following the same logic, which can lead to the following sources of error. In this examples a function $f(p) is used, which evaluates the "p" parameter. A second function $now( ) simply returns the current date as DateTime object. | Syntax | Possible expectations for p | Actual value of p | Explanation | | --- | --- | --- | --- | | $f($now()) | A valid DateTime object | An expected valid DateTime object | $now( ) was evaluated and passed to $f(p) | | $f( $now() ) | A valid DateTime object | Text: "[object Object]" | $now( ) evaluated correctly and returned a valid DateTime object, but this object was concatenated with a leading and trailing space. Therefore the object has to be converted into a text. Since this is not easily possible in the case of any object, the text representation "[object Object]" results | ### Transfer control characters as text (Escaping) Additionally, with a prefixed "\" (backslash), any character can be excluded from the evaluation of the logical expressions and interpreted as normal text.For example, "$" characters can be included in a constant text. Examples: | Syntax | Explanation | | --- | --- | | $funktionsname( ) | Executes the function "functionname" and writes the return value into the result | | \$funktionsname( ) | Writes "$function name( )" in the result | ### Access to resources (entries from language administration) A special expression syntax has been defined for resolving resources, which makes it unnecessary to call a separate function: **Syntax:** *[Bundle, resource, default... Parameterlist]* Example: `[common,cancel]`Returns "Cancel". For details, see [Access to localized resources (Calculation expression)](/v1/docs/en/calc-function-rs). ### Access to data fields Values can be read from data fields of the input object ($input) via curly brackets {}. The data field can also be specified as a path. Individual data fields in the path are separated from each other with "." (e.g. *{data fieldFirstLevel.data fieldSecondLevel.data fieldThirdLevel}* ). **Tip**: For list elements, the index (starting with 0) can be specified as the data field name. e.g. data fieldTheList.3 → Reads the fourth entry of the list. For more details and examples, see also [Access to data fields in calculation expressions](/v1/docs/en/core-raw-parser-datafields). ## Calculation expressions in forms If a calculation printout is evaluated in the context of forms, the values of form elements can be included directly. This is done using a function called "**el**". **Syntax:** *$el(ElementId[, Duplikate])* The corresponding element ID is passed as a parameter, whose value is read and returned. In the case of an element container, its element data is returned. If this is a duplicate element (e.g. within a [Repeatable element](/v1/docs/en/fre-duplicate-element-container-vo)), the second, optional parameter can be specified as "true" to read the list of values of all duplicated instances (formerly ALLFIELDS(element-id)). **Tip:** Together with the "get" function, data fields of an element or any other value can be accessed easily and conveniently. Example**:** An element container with element ID #6 contains the data presented earlier in this chapter as JSON. When clicking on a button "GET lastName" the last name of the person is displayed in a message box. For this purpose, a [Calculate](/v1/docs/en/frebehav-calculate) behavior is added to the button, which evaluates the following expression: | $get($el(6),person.lastName) | | --- | As an action, "Show alert" is selected, and the message evaluates and displays the expression "$input" (the calculated value of the behavior). ![images/download/attachments/137313502/image-2023-8-9_16-40-59-version-1-modificationdate-1691592043391-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-8-9_16-40-59-version-1-modificationdate-1691592043391-api-v2.png) When you press the button, a window appears which displays the surname "Abend". ![images/download/attachments/137313502/image-2023-8-9_16-42-39-version-1-modificationdate-1691592143068-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2023-8-9_16-42-39-version-1-modificationdate-1691592143068-api-v2.png) ## Available constants and functions All available functions and constants are listed and documented in the child pages. - [Constants (Calculation expression)](/v1/docs/en/calc-function-constants) - [Data (Calculation expression)](/v1/docs/en/calc-function-data) - [Access to localized resources (Calculation expression)](/v1/docs/en/calc-function-rs) - [collect (collect object field values from input list)](/v1/docs/en/calc-function-collect) - [contains](/v1/docs/en/calc-function-contains) - [copy (Copy objects)](/v1/docs/en/calc-function-copy) - [eval (Execute calculation expression)](/v1/docs/en/calc-function-eval) - [findFirst, findAll (Find values in lists)](/v1/docs/en/calc-function-find) - [get (Read value from data field)](/v1/docs/en/calc-function-get) - [isUnique](/v1/docs/en/calc-function-is-unique) - [merge (Merge objects)](/v1/docs/en/calc-function-merge) - [notEmptyFilter (List non-empty values)](/v1/docs/en/calc-function-not-empty-filter) - [ta (Read typed attribute)](/v1/docs/en/calc-function-ta) - [with](/v1/docs/en/calc-function-with) - [Access to data fields in calculation expressions](/v1/docs/en/core-raw-parser-datafields) - [Logic (Calculation expression)](/v1/docs/en/calc-function-logic) - [cmp (Compare)](/v1/docs/en/calc-function-cmp) - [if (if, then, else)](/v1/docs/en/calc-function-if) - [ifEmpty](/v1/docs/en/calc-function-if-empty) - [ifNotEmpty](/v1/docs/en/calc-function-if-not-empty) - [or (Logical Or)](/v1/docs/en/calc-function-or) - [and (Logical And)](/v1/docs/en/calc-function-and) - [not (Logical negation)](/v1/docs/en/calc-function-not) - [isNull (Check for NULL or undefined)](/v1/docs/en/calc-function-is-null) - [isArray](/v1/docs/en/calc-function-is-array) - [Text (Calculation expression)](/v1/docs/en/calc-function-text) - [replace](/v1/docs/en/calc-function-replace) - [concatWs (Concatenate texts)](/v1/docs/en/calc-function-concat-ws) - [decodeURIComponent](/v1/docs/en/calc-function-decode-uri-component) - [encodeURIComponent](/v1/docs/en/calc-function-encode-uri-component) - [fn (Format number)](/v1/docs/en/calc-function-fn) - [getUrlParam](/v1/docs/en/calc-function-get-url-param) - [isEmpty (Check for empty)](/v1/docs/en/calc-function-is-empty) - [length (Text length)](/v1/docs/en/calc-function-length) - [split (Split separated text)](/v1/docs/en/calc-function-split) - [substring (Extract a section of text)](/v1/docs/en/calc-function-substring) - [toLower (Calculation expression – convert to lower case)](/v1/docs/en/calc-function-to-lower) - [toUpper (Calculation expression – convert to uppercase)](/v1/docs/en/calc-function-to-upper) - [trim (Calculation expression – cutting off whitespaces)](/v1/docs/en/calc-function-trim) - [HTML (Calculation expression)](/v1/docs/en/calc-function-html) - [contrastColor (Calculate contrast color)](/v1/docs/en/calc-function-contrast-color) - [cssColor](/v1/docs/en/calc-function-css-color) - [getStyleVar (Reading a style property)](/v1/docs/en/calc-function-get-style-var) - [htmlEscape](/v1/docs/en/calc-function-html-escape) - [Mathematics (Calculation expression)](/v1/docs/en/calc-function-math) - [avg (Average)](/v1/docs/en/calc-function-avg) - [calc (Calculate expression)](/v1/docs/en/calc-function-calc) - [count (Number of list entries)](/v1/docs/en/calc-function-count) - [dif (Difference)](/v1/docs/en/calc-function-dif) - [evalCalc (Determine and calculate function expression)](/v1/docs/en/calc-function-eval-calc) - [max (Maximum)](/v1/docs/en/calc-function-max) - [min (Minimum)](/v1/docs/en/calc-function-min) - [numFilter (Number filter)](/v1/docs/en/calc-function-num-filter) - [product (Multiplication)](/v1/docs/en/calc-function-product) - [quotient (Division)](/v1/docs/en/calc-function-quotient) - [sum (Addition)](/v1/docs/en/calc-function-sum) - [Date (Calculation expression)](/v1/docs/en/calc-function-date) - [dateAdd (Date add up)](/v1/docs/en/calc-function-date-add) - [dateCalc (Calculate date)](/v1/docs/en/calc-function-date-calc) - [dateRange (Create date range)](/v1/docs/en/calc-function-date-range) - [fd (format date)](/v1/docs/en/calc-function-fd) - [getCalendar (Get calendar of a date field)](/v1/docs/en/calc-function-get-calendar) - [getUserTimezone (Get user time zone)](/v1/docs/en/calc-function-get-user-timezone) - [now (Current client date and time)](/v1/docs/en/calc-function-now) - [nowTime (Current client time)](/v1/docs/en/calc-function-now-time) - [parseDate (Date value from text)](/v1/docs/en/calc-function-parse-date) - [timestamp (Timestamp)](/v1/docs/en/calc-function-timestamp) - [today (Current day of the client)](/v1/docs/en/calc-function-today) - [Tax rate (Calculation expression)](/v1/docs/en/calc-function-tax) - [taxRate (Steuersatz)](/v1/docs/en/calc-function-tax-rate) - [Form editor (Calculation expression)](/v1/docs/en/calc-function-fre) - [el (Read element data)](/v1/docs/en/calc-function-el) - [isElValid (Validating element)](/v1/docs/en/calc-function-is-el-valid) - [parentData](/v1/docs/en/calc-function-parent-data) - [var (Read form variable)](/v1/docs/en/calc-function-var) - [elLabel (Read element label)](/v1/docs/en/calc-function-el-label) - [viewName (Calculation function)](/v1/docs/en/calc-function-view-name) - [Converter (Calculation expression)](/v1/docs/en/calc-function-convert) - [intToHex (Convert integer to hexa decimal format)](/v1/docs/en/calc-function-int-to-hex) - [className (Class name)](/v1/docs/en/calc-function-class-name) - [parseJSON](/v1/docs/en/calc-function-parse-json) - [toBigDecimal (Conversion to large decimal integer)](/v1/docs/en/calc-function-to-big-decimal) - [toInteger (Conversion to large integer)](/v1/docs/en/calc-function-to-integer) - [toJSON](/v1/docs/en/calc-function-to-json) - [toLong (Conversion to large integer)](/v1/docs/en/calc-function-to-long) - [toNumber (Conversion to native number)](/v1/docs/en/calc-function-to-number) - [toString (Convert to a string)](/v1/docs/en/calc-function-to-string)