--- title: "Store value as variable" slug: "core-store-value-resolver" updated: 2026-04-27T08:17:47Z published: 2026-04-27T08:17:47Z canonical: "docs.lobstersoftware.com/core-store-value-resolver" --- > ## 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. # Store value as variable > [!NOTE] > Value resolver – Abstract > > **Purpose:** Assigns the *input value* of the variable addressed via the **Variable Name** parameter in the execution context. > > > [!TIP] > > Tooltip > > > > - **Usage**: The input value is assigned to the variable addressed via the **Variable Name** parameter in the execution context of the value resolver. This is either overwritten or newly created. > > - **Parameter**: The single **Variable Name** parameter defines the name of the variable for value assignment by static text. It is only formally optional. Without specifications the value resolver is effectively ineffective. > > - **NOTE:** Assignments to a variable whose name is determined "dynamically" by the value resolver at runtime are only possible by write access via the [Variable](/v1/docs/en/core-storage-value) value resolver in event actions (e.g. [Set value](/v1/docs/en/core-set-value-actor)). ![images/download/attachments/177908237/image-2024-8-13_15-56-24-version-1-modificationdate-1723557384251-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-13_15-56-24-version-1-modificationdate-1723557384251-api-v2.png) The [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver assigns the input value to the variable addressed via the optional **Variable** **Name** parameter in the execution context. - If the **Variable Name** parameter does not contain any information, then the *input value* will not be saved. - If the addressed variable is already in use in the execution context, it will be overwritten. - If the addressed variable does not yet exist in the execution context, it is added. In each case, the *input value* is returned unchanged. In the context of a value resolution chain, any intermediate result can be literally stored "at random" in order to be able to access it in the further course or to examine the value in the context of [Tests](/v1/docs/en/core-testing-set). While in [Event handling](/v1/docs/en/administration-designer-workflow-action-event-handler-configuration) or in a [Client Workflow](/v1/docs/en/frebehav-client-workflow) the value of a variable can alternatively be assigned by an event action (e.g. by [Set value](/v1/docs/en/core-set-value-actor) with a [Variable](/v1/docs/en/core-storage-value) value resolver as target), the [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver e.g. in [Association criteria](/v1/docs/en/core-association-criteria) represents the only possibility to store a value directly in the execution context. ## Configuration | The optional **Variable Name** parameter defines by a static text the name for a variable in the execution context to which the *input value* is assigned as a value. - Without any information in the **Variable Name** parameter, no error will occur. However, the value resolver is then effectively meaningless. In the example on the right, the [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver is used within a value resolver chain, which assigns the new company account created via a [Create instance](/v1/docs/en/core-create-instance-resolver) value resolver in the *input value* of the `newCompanyAccount` variable, whose `address` field is "used" in the further course of the chain. The `newCompanyAccount` variable provides access to the newly created company account in operations performed after accessing the company address in the context of the current value resolution chain. | ![images/download/attachments/177908237/image-2024-8-13_16-1-32-version-1-modificationdate-1723557692165-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-13_16-1-32-version-1-modificationdate-1723557692165-api-v2.png) | | --- | --- | **NOTE:** If the **Variable Name** is not determined statically in the configuration but rather at runtime, only an assignment via event action (e.g. with the [Set value](/v1/docs/en/core-set-value-actor) value resolver) can be considered. If the target of the assignment is determined by the [Variable](/v1/docs/en/core-storage-value) value resolver, the name of the variable can be determined via value resolver. ## Example ### Simple use case: Save intermediate result in a multilevel calculation Based on numerical values for "quantity" (`quantity`), "unit price" (`unitPrice`) and an applicable "tax rate" (taxRate) specified in percent, in addition to the resulting "gross amount" (`grossAmount`), the "net amount" (`netAmount`) should also be calculated as follows: - `netAmount = quantity * unitPrice` - `grossAmount = netAmount * (1+taxRate/100)` The following configuration demonstrates how the "net amount" can be stored as an intermediate result in a value assignment for the "gross amount" via the [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver. The subsequent use of the `netAmount` and `grossAmount` variables is not discussed here. Configuration: | Within an event handling that is triggered when a business object is saved, a [Set value](/v1/docs/en/core-set-value-actor) event action is executed that calculates the "gross amount" and writes its value as a total result to the `grossAmount` variable. - On the left side of the assignment, a [Variable](/v1/docs/en/core-storage-value) value resolver points to the variable `grossAmount` as the target of the assignment. - On the right side of the assignment, a value resolution chain defines the calculation process and the required intermediate result: - The first [Calculate value](/v1/docs/en/core-calculate-value-resolver) resolver calculates the product of quantity and unit price. The configurations for the `quantity` and `unitPrice` variables, which are not expanded in the image, "read" the corresponding data of the business object at runtime. They apply only within the calculation. The result of the first calculation is the desired intermediate result "Net amount". It is written as "Unit number" by the concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver into the variable `netAmount`. - The second [Calculate value](/v1/docs/en/core-calculate-value-resolver) resolver calculates the "gross amount" from the "net amount", which includes a percentage markup to the "net amount" defined via the variable `taxRate`. The formula accesses the *input value* of the value resolver via the automatically provided `input` variable. Instead, the `netAmount` variable could also be addressed for the intermediate result in the given configuration. | ![images/download/attachments/177908237/image-2024-8-13_16-10-10-version-1-modificationdate-1723558210028-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-8-13_16-10-10-version-1-modificationdate-1723558210028-api-v2.png) | | --- | --- | **NOTE:** The concept demonstrated here can also be applied in a multi-step manner in the same value resolution chain to transfer a series of intermediate results into variables. ### More complex use case: "Validating rule" occupies variables for the "Actions on passed rule" In an event handling, the **Validating rule** determines whether the company to which the logged-in user account (according to [User of session](/v1/docs/en/base-session-user-value)) refers as "owner" (`ownerId`) owns its company account *itself* or not. Actions should only be executed if this is *not* the case. Among other things, a notification then indicates ownership. Runtime example: | The "Username" for the [User of session](/v1/docs/en/base-session-user-value) appears in the "Title" of the notification. The "message" below displays, in the context of a text concatenation (including literals to clarify ownership), the name of the "owner" company of this user account ("Vortex Inc.") and the name of its "owner" company ("Xflow AG"). | ![images/download/attachments/177908237/image2022-10-4_15-26-14-version-1-modificationdate-1723557295981-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image2022-10-4_15-26-14-version-1-modificationdate-1723557295981-api-v2.png) | | --- | --- | Configuration: ![images/download/attachments/177908237/image-2024-9-2_11-40-40-version-1-modificationdate-1725270040362-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-2_11-40-40-version-1-modificationdate-1725270040362-api-v2.png) The **Validating rule** of an event handler shown above defines an [Entity property rule](/v1/docs/en/core-entity-property-rule) that compares the "owner" (`ownerId`) field for the [User of session](/v1/docs/en/base-session-user-value) with the same field in the company account referenced there as "owner": - On the left side of the comparison, the ID of the company that owns the [User of session](/v1/docs/en/base-session-user-value) is determined: - The value resolver chain starts with the [User of session](/v1/docs/en/base-session-user-value) value resolver, which returns the logged in user account. - The concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores this user account in the `me` variable. **NOTE:** The [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action in the "Title" refers to this variable. - The concatenated [Object property](/v1/docs/en/core-property-resolver) value resolver reads the "owner" (`ownerId`) field of the user account that is the [User of session](/v1/docs/en/base-session-user-value). - The concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores the ID of the company account specified as "owner" in the `myOwnerId` variable. **NOTE:** The [Variable](/v1/docs/en/core-storage-value) value resolver at the beginning of the value resolver chain on the right-hand side of the [Entity property rule](/v1/docs/en/core-entity-property-rule) refers to this variable. - On the right side of the comparison, the ID of the company that owns the company account that owns the [User of session](/v1/docs/en/base-session-user-value) is determined. - The value resolver chain starts with the `myOwnerId` variable, where a lookup is performed for the **Class** "Company account" (`CompanyAccount`) (see [Variable](/v1/docs/en/core-storage-value) value resolver). - The concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores the company account looked up via the [Variable](/v1/docs/en/core-storage-value) value resolver in the `myOwner` variable. **NOTE:** The [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action in the configuration of the "Message" refers to this variable. - The concatenated [Object property](/v1/docs/en/core-property-resolver) value resolver reads the "owner" (`ownerId`) field of the user account, the company account that owns the [User of session](/v1/docs/en/base-session-user-value). - The concatenated [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver stores the ID of the company account specified as "owner" in the `myOwnersOwnerId` variable. **NOTE:** The [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action in the configuration of the "Message" refers to this variable. Since the **Validating rule** is always processed before any **Actions on passed rule** are executed, in its context the variables addressed via the [Store value as variable](/v1/docs/en/core-store-value-resolver) value resolver are populated as follows: | Variable | Content | Data type | Use in a [Show alert (Popup)](/v1/docs/en/core-popup-actor) event action | | --- | --- | --- | --- | | `me` | [User of session](/v1/docs/en/base-session-user-value). | "User" | Read access to the "username" field in the "Title". | | `myOwnerId` | ID of the company account that owns the [User of session](/v1/docs/en/base-session-user-value). | `Long` | *Not used* (only within the **Validating rule**). | | `myOwner` | Data of the company account that owns the [User of session](/v1/docs/en/base-session-user-value). | "Company account" | Read access to the "name" field of the address (`address.name1`). | | `myOwnersOwnerId` | ID of the company account that owns the `myOwner` company account. | `Long` | Read access to the "name" field of the address (`address.name1`) after looking up the relevant company account by ID via the [Variable](/v1/docs/en/core-storage-value) value resolver with **Class** "Company account". | ![images/download/attachments/177908237/image-2024-9-2_15-17-46-version-1-modificationdate-1725283066786-api-v2.png](https://cdn.document360.io/4be90b94-ec83-41d8-963e-962df16110d4/Images/Documentation/image-2024-9-2_15-17-46-version-1-modificationdate-1725283066786-api-v2.png)