--- title: "Variable rule" slug: "core-storage-string-rule" updated: 2026-04-02T13:44:09Z published: 2026-04-02T13:44:09Z canonical: "docs.lobstersoftware.com/core-storage-string-rule" --- > ## 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. # Variable rule *See also:* [Entity property rule](/v1/docs/en/core-entity-property-rule)*,* [Variable](/v1/docs/en/core-storage-value) > [!NOTE] > Rule type – Abstract > > **Purpose:** Is considered 'passed' if a variable exists in the current data context that matches the corresponding configuration parameters in terms of name and value. > > > [!TIP] > > Tooltip > > > > - **Usage**: The rule checks whether the string-converted return value of the variable specified by **Name** matches the **Value** statically determined in the configuration. > > - **Parameter**: The **Name** parameter defines the name of the variable whose value should pass a string comparison with the input for the **Value** parameter. > > - **NOTE:** The [Variable rule](/v1/docs/en/core-storage-string-rule) is not suitable for evaluating more complex data objects that are stored in a variable. ![images/download/attachments/201665605/image-2025-3-28_6-59-24-version-1-modificationdate-1743141564953-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-28_6-59-24-version-1-modificationdate-1743141564953-api-v2.png) The [Variable rule](/v1/docs/en/core-storage-string-rule) checks whether a [Variable](/v1/docs/en/core-storage-value) exists in the context of the current transaction whose name matches the character string in the **Name** parameter and whose value (either directly or as a *string image*) corresponds to the character string in the **Value** parameter. > [!NOTE] > **IMPORTANT:** If the [Variable](/v1/docs/en/core-storage-value) addressed by **Name** contains a value whose data type is not a `String`, its *string image* is compared with the **Value**. There are data types (enumeration values, date values, etc.) for which a different *string image* applies depending on the execution context (server/client). > > Specific example: > > - If a `status` variable contains the value 'New' (`NEW`) from the dynamic enumeration [Working state](/v1/docs/en/base-working-states), a variable rule (with the Name status ) is considered to have passed in the *server context* if the **Value** `NEW` (the internal name of the enumeration value) is specified. > - In the *client context*, a [Variable rule](/v1/docs/en/core-storage-string-rule) (with **Name** `status`) is only considered to have passed if the **Value** matches the localisation applicable in the execution context for the enumeration value (*here* 'New' for the [Current locale](/v1/docs/en/core-current-locale-resolver) 'German'). > - Regardless of the execution context, the [Variable rule](/v1/docs/en/core-storage-string-rule) cannot distinguish whether the [Variable](/v1/docs/en/core-storage-value) `status` contains the checked `String` directly as a value or another value that returns it as a *string image*. > - A [Variable rule](/v1/docs/en/core-storage-string-rule) could also not distinguish whether the enumeration value 'New' (`NEW`) is really a [Working state](/v1/docs/en/base-working-states) or a value with the same name (*server context*) or the same localisation (*client context*) from another enumeration (e.g. [Incident status](/v1/docs/en/scem-incident-state)). ## Configuration | ![images/download/attachments/201665605/image-2025-3-28_7-0-32-version-1-modificationdate-1743141632658-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-28_7-0-32-version-1-modificationdate-1743141632658-api-v2.png) The **Name** and **Value** parameters are required fields of the configuration. Therefore, the [Variable rule](/v1/docs/en/core-storage-string-rule) cannot check variables for 'no value'. | - The static entry for **Name** must exactly match the name of a variable in the given context. If no such variable exists, the rule fails. - The static entry for **Value** must exactly match the string returned in place of the value of that variable. - String variables return their value directly. An empty string is not identical with a null value. The latter cannot be defined as a **Value** in the rule. - When evaluating numeric content, the **Value** string must resemble the characters stored in the variable's value. A value of '6.00' (big decimal) is not identical with a value of '6' (integer). - Boolean values can be validated against strings ('true', 'false'). - For values of dynamic enumerations, the string of the internal name is returned. For example, [Salutation](/v1/docs/en/base-salutation) 'Mr' matches a **Value** of 'MR'. | | --- | --- | **NOTE:** - The [Variable rule](/v1/docs/en/core-storage-string-rule) is not suitable for inspecting complex objects stored in variables. - However, it is always an option to use a [Entity property rule](/v1/docs/en/core-entity-property-rule) in combination with a [Variable](/v1/docs/en/core-storage-value) resolver instead of using a [Variable rule](/v1/docs/en/core-storage-string-rule). - The [Variable rule](/v1/docs/en/core-storage-string-rule) can be used in combination with the event action [E-mail](/v1/docs/en/core-send-mail-actor) to define an association criterion identifying a specific [Print document](/v1/docs/en/core-print-document-content-builder). ## Example In the context of an event handler, a [E-mail](/v1/docs/en/core-send-mail-actor) action should be replaced by a [Show alert (Popup)](/v1/docs/en/core-popup-actor), when the event handler is executed in test mode. ![images/download/attachments/201665605/image-2025-3-28_7-3-8-version-1-modificationdate-1743141788281-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2025-3-28_7-3-8-version-1-modificationdate-1743141788281-api-v2.png) - Inside an [If then else](/v1/docs/en/core-if-then-else-actor) action, the [Variable rule](/v1/docs/en/core-storage-string-rule) checks for a variable named 'isTest' with a value of 'true' in the context of the transaction. - Although the variable contains a `Boolean` value (see note below), the [Variable rule](/v1/docs/en/core-storage-string-rule) checks for the string (*here* 'true'). **NOTE:** During [Tests](/v1/docs/en/core-testing-set), variables and their values can be inspected in the 'Variables' tab. The variable 'isTest', which is automatically provided by the system when a test is executed, is featured as follows: ```xml               isTest         true       ```