> For the complete documentation index, see [llms.txt](https://docs.eximee.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md).

# Managing session variables

## Session Variables Panel

The panel for managing session variables is **Session Variables**. To open it, select the option **Session Variables**. A magnifying glass icon on the right side of the panel's title bar lets you search the list of variables.

![Figure 1. “Session Variables” panel](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/BcroviOfWC9Q80mbHuVa/1k_files/image2025-8-18_9-40-11.png)

### Adding a new session variable

To add a new session variable, click **Add session variable**.

In the new row added at the top of the panel, fill in:

* **Mid** - variable key
* **Default value** - constant variable value
* **Service ID** - after the session variable is linked to a service, the service name appears here
* **Output parameter** - if the session variable is an output parameter of the service, it is specified here
* **Exposed** - select whether the session variable should be passed to the client **explicitly**. This option lets you use the session variable in conditional expressions and formatters that run on the client side. If the checkbox is cleared, the session variable is not sent to the client.
* **Gtm**
* **GTM tag** - GTM tag name
* **Statistics** - enable sending the variable's value to statistics.

![Figure 2. Session variable creation row](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/OBe7eOTHhFNotMT0L3z1/4k_files/image2025-8-18_9-42-44.png)

When you leave the name field, the variable is created. If no name is defined for the variable, the system automatically assigns the value “empty,” or a copy of that value if it has already been used.

### Editing an existing session variable

To change a variable's name, click in the **Mid**column, enter the new name, and leave the field by pressing Tab or clicking elsewhere. Pressing Enter alone does not save the change.

Designer renames the variable and replaces the old name with the new one everywhere in the process that refers to the variable (see the list in [Where the session variable is used](#miejsca-uzycia-zmiennej-sesyjnej)). The rest of the field remains unchanged, and a variable whose name merely starts with the same text is left untouched. The change applies to the process draft; published versions are not changed.

Renaming example `zmienna1` to `zmienna2`:

| Field before renaming                                                     | Field after renaming                                                                        |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- |
| Condition `js:getValue("zmienna1") == getValue("zmienna10")`              | `js:getValue("zmienna2") == getValue("zmienna10")`                                          |
| Translation `Kwota: ${zmienna1}`                                          | `Kwota: ${zmienna2}`                                                                        |
| Frontend component configuration `kwota=zmienna1` and `zmienna1=etykieta` | `kwota=zmienna2` and `zmienna1=etykieta` (the key before the character `=` does not change) |
| Service parameter with a constant value `zmienna1`                        | remains unchanged because a constant value is not a reference                               |

Clicking **Undo** restores the old name everywhere, while **Redo** reapplies the new one.

{% hint style="warning" %}
In fields where the entire value is the name of a variable or component (e.g. a listener or a component's value source), Designer does not distinguish between a variable and a component with the same name. If a component ID matches the old variable name, references to that component in these fields will also be renamed.
{% endhint %}

### Defining a service output

A session variable can be used to store the result of executing a service defined on any page in the current application.

We define the mapping of a variable to the corresponding service output field in the **Page services**, which we open by clicking the **Page services**:

![Figure 3. List of services available in the application, displayed after clicking the "Page services" button](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/fC2C0ha0doezg5sTP1mK/4k_files/image2022-12-12_11-36-59.png)

Once the list of services available to the application appears, find the relevant service and then expand its details by clicking the option on the right side of the panel: **Show details**. You can map the service output to a variable by clicking **Output parameters** in the displayed details:

![Figure 4. Expanded details for PageService1](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/JMYUMNL5O3S0qZ8wYN7W/4k_files/image2022-12-12_11-41-3.png)

In the output parameters tab, click the **Add parameter** button — a row will appear. First, in the **Application component**column, select the session variable to which you want to map the output, then in the **Output parameter**column, select the appropriate output:

![Figure 5. In the "Output parameters" tab, a session variable has been selected; the output parameter still needs to be selected](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/PXlt6W7JNzmwjOHG1kG2/4k_files/image2022-12-12_11-44-38.png)

Once the service has been successfully connected to the variable, its properties will show the connected service and the selected output parameter:

![Figure 6. In the session variables panel, for a variable connected to a service, its name appears in the "Service ID" column, with the service's output parameter next to it](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/LErHsgmbjGELgZWqYnz6/4k_files/Zaznaczenie_134.png)

### Deleting a session variable

To delete a session variable, hover over its row and click the trash icon.

Designer only deletes a variable that is not referenced anywhere in the process. If the variable is used in any of the places listed under [Session variable usage locations](#miejsca-uzycia-zmiennej-sesyjnej), including in a condition, Designer will not delete it and will display a message with the number of occurrences:

![Figure 7. Tooltip explaining that the session variable cannot be deleted](https://content.gitbook.com/content/2CssJT0zIo4SJQLbSZ6l/blobs/mHAMH9I31j2bPLp3NXfq/4k_files/image2025-8-18_9-44-37.png)

The message gives the number of occurrences, meaning the number of fields that reference the variable. It is visible for 10 seconds and includes the **Show occurrences**action, described in [Session variable occurrences](#wystapienia-zmiennej-sesyjnej). To delete a variable that is in use, first remove its references, then try deleting the variable again.

### Session variable occurrences

To see where the process references the variable, click **Show occurrences** in the message about the variable being used. The **Variable occurrences** window opens with the variable name in the header and a list of all fields that reference it. The window is for viewing only and does not change anything in the process. If the message disappears before you click the action, click the trash icon again.

Fields are grouped by the Designer tabs where you edit them. When the window opens, the groups are collapsed, and each group header shows the number of fields it contains. Click a header to expand the group.

| Group                                     | Fields in the group                                                                                                               |
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| **Application › Page** with the page ID   | component fields on the page, the page’s own fields and its bottom bar, and the page’s page services; each page has its own group |
| **Application**                           | application input parameters                                                                                                      |
| **Steps**                                 | application steps, payment, and save point                                                                                        |
| **Properties**                            | tab sections **Properties**, e.g. entry services, form actions, parking                                                           |
| **Translations**                          | translation texts, with a separate row for each language                                                                          |
| **Data model**                            | field mappings and conditional groups                                                                                             |
| **Source (not editable in the Designer)** | elements that cannot be edited in any Designer editor, e.g. a page curtain; you can fix the reference in the **Source**           |

Each row shows the field’s location, ending with its name, and the field’s full value. A component is identified by its type and ID. The variable name is highlighted in the value, but only when it appears as a whole: in the value `getValue("zmienna10")` nothing is highlighted for the variable `zmienna1`.

To go to the place where it is used, click **Go to** in the row. The Designer closes the window and the **Session variables** panel, then opens:

| Place of use                                               | What opens **Go to**                                                                            |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| component field                                            | the component’s page with the component selected and its attributes panel open                  |
| page field, including its bottom bar                       | this page, selected, with the page attributes panel open                                        |
| page service                                               | this page with the left-hand panel open **Page services**                                       |
| application input parameter                                | the **Application** tab, with the left-hand panel open **Input parameters**                     |
| field in the group **Properties**                          | tab **Properties** scrolled to the section where you edit this element, e.g. **Input Services** |
| field in the group **Translations**                        | tab **Translations** with the table filtered by the translation key                             |
| field in the group **Steps**, **Data Model** or **Source** | tab in this group                                                                               |

Navigation does not change the process: it only changes the open tab, page, selection, and translation table filter.

Example: the variable `zmienna1` is used in the validator condition of the `walidator1` component `kwota` on the `wniosek`.

1. In the **Session Variables** panel, click the trash icon next to the variable `zmienna1`. Designer displays a message showing 1 occurrence.
2. In the message, click **Show occurrences**. The window has the group **Wniosek › Strona wniosek** collapsed, with one field.
3. Expand the group. The row shows the location: component `kwota` › validator `walidator1` › **Condition**, and `zmienna1`.
4. is highlighted in the condition value. Click **Go to**. Designer displays the page `wniosek` with the component `kwota selected` and its attributes panel.
5. Remove the validator condition or change it so that it does not refer to `zmienna1`.
6. Open the panel **Session variables** and delete the variable `zmienna1` again.

{% hint style="info" %}
Window **Variable occurrences** works the same way in the composite component editor and the business component editor. The group containing the component page is called **Component › Page**, and **Go to** opens the **Component**tab. Fields that the component editor does not display in any tab (process steps and properties, and, for a composite component, the data model) are in the group **Source (no editor in Designer)**.
{% endhint %}

### Using a session variable to set a component's initial value

To use a session variable to set an element's initial value, follow these steps:

* Select the component.
* In the list of available properties, find the property in the Interactions section **DATA SOURCE FROM ANOTHER FIELD**
* after clicking **Select a component or constant** you can select the session variable's mid to use as the element's default value,
* you must also add a listener for the variable as described in: [Listening and clearing](https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/dynamicznosc-formularza/nasluchiwanie-i-czyszczenie.md)

### Using a session variable to retrieve a component's value

For the session variable, select the EchoService service added to the application page.

### Examples of using a session variable

* Using a session variable in a condition: getValue("@zmienna1")=="Y" where zmienna1 is the name of the variable
* Using a session variable in the Label component: The current variable value is ${zmienna1} where zmienna1 is the name of the variable

{% hint style="warning" %}
Note!

1. If you use a session variable in a composite component, add the @ symbol before its name (this notation is not used for predefined variables).
2. Session variables cannot be used in [Repeatable section - RepeatableSection](https://github.com/Consdata/eximee-docs/tree/main/budowanie-aplikacji/interfejs-uzytkownika/formularze/biblioteka-komponentow-bazowych/sekcja-powtarzalna-repeatablesection.md) — use technical fields here.
   {% endhint %}

{% hint style="info" %}
Demo application: demoZmienneSesyjne
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
