> 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/logika-biznesowa/przekazywanie-wartosci-miedzy-komponentami-lub-stronami-wniosku.md).

# Passing values between application components or pages

Platform **Eximee Designer** enables passing values from one component to another. Depending on whether the components are in the same artifact or in two different ones, the value is passed in different ways. We will also act differently when we only want to pass a value and differently when we want to use the passed value, e.g. by making visibility depend on it.

## Passing a value between components located in the same artifact <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscimiedzykomponentamiznajd" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscimiedzykomponentamiznajd"></a>

If there is a need to copy a value from one Text Field to another or to another component, e.g. to the content of a declaration or from a Value Selection Field (Combobox) displaying a list of identity document types to another Combobox, you can, in the component to which we want to pass the value:

* Use a script *EchoServiceScript* (select in the section **Interactions** in the field **EXTERNAL DATA SOURCE** the option **Select service** and indicate that script), in which the component passing the data should be provided as input. In the script output parameters, the script output should be mapped appropriately to the component attribute. This approach additionally gives us the possibility to specify a formatter that will appropriately modify the data received from the script.

  <figure><img src="/files/a44ad36d7873bf398d5deb33304d4e15aa865ba3" alt=""><figcaption><p align="center"><em><strong>Figure 1.</strong> Example of the attached "EchoServiceScript"</em></p></figcaption></figure>
* Select in the field **DATA SOURCE FROM ANOTHER FIELD** data-passing component:

<figure><img src="/files/3d952e0e11fa0d7dccfabc18eecd57b0b97fa96f" alt=""><figcaption><p align="center"><em><strong>Figure 2.</strong> Setting as the data source the component from which the data will be retrieved</em></p></figcaption></figure>

* Select in the field **DATA SOURCE FROM ANOTHER FIELD** a session variable for which a service has been defined to pass a value from another component:\ <br>

  <figure><img src="/files/5127e614100ce8bc4114478ea545973c56bd5151" alt=""><figcaption><p align="center"><em><strong>Figure 3.</strong> Setting the session variable from which values will be passed</em></p></figcaption></figure>
* Select in the field **EXTERNAL DATA SOURCE** a service previously defined on the page (with input from the data-passing component):<br>

  <figure><img src="/files/ab285d5b76cc26f7054fcb480933dffb3b39cafd" alt=""><figcaption><p align="center"><em><strong>Figure 4.</strong> Attaching "PageService"</em></p></figcaption></figure>

{% hint style="info" %}
In all cases, remember to listen on the component whose value we are copying (more on the topic: [Listening and clearing](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/dynamicznosc-formularza/nasluchiwanie-i-czyszczenie.md)).<br>
{% endhint %}

<figure><img src="/files/922d9de8de22ab4f1e2acf56414c244d7d5fbbec" alt=""><figcaption><p align="center"><em><strong>Figure 5.</strong> Example of copying values from Text Fields to Labels</em><br><em>(using "EchoService", "DATA SOURCE FROM ANOTHER FIELD" and a session variable)</em></p></figcaption></figure>

Applying the above instructions to a value selection field/Date (and other components that pass a value, not the displayed content, label or description) would cause the value of that component to be passed. To pass the text (description or label), you should:

* if the content (label or description) is to be passed through **DATA SOURCE FROM ANOTHER FIELD**, instead of selecting the data-passing component there, enter:<br>
  * for the value selection field (Combobox), after its id add **$label**, e.g. *GesCombobox1$label*:

    <figure><img src="/files/ac6f00184e71037e1d058a442503338a3cbb805d" alt=""><figcaption><p align="center"><em><strong>Figure 6.</strong> Passing text from the Value Selection Field (Combobox) component</em></p></figcaption></figure>

    <p align="center"><br></p>
  * for Date (DatePicker) after its id add **$displayValue**, e.g. *GesDatePicker1$displayValue*
* if the content (label or description) is to be used in the content of another component (e.g. in the section title, added to the content or label), refer to this value selection field/Date as follows:<br>
  * for the value selection field, provide the component id in curly braces preceded by a dollar sign with added *$label,* e.g. *${GesCombobox1$label}*:<br>

    <figure><img src="/files/e929c5985b6932a7a1f6c959b546ed41447a6c2e" alt=""><figcaption><p align="center"><em><strong>Figure 7.</strong> Example of using text from the Value Selection Field in a section title</em></p></figcaption></figure>

<p align="center"><br></p>

* for Date, provide the component id in curly braces preceded by a dollar sign with added *$displayValue,* e.g. *${GesDatePicker1$displayValue}.*

{% hint style="info" %}
The list of component attributes available after "$" is described in: [Component attributes](/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/jezyk-wyrazen-definiowania-warunkow-warunki-z-getvalue/atrybuty-komponentow.md).
{% endhint %}

## Passing values between components located in different artifacts <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscimiedzykomponentamiznajd" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscimiedzykomponentamiznajd"></a>

If the components are not in one artifact (the same composite component), then values should be injected into the target artifact. It does not matter whether both composite components are on the same application page.

Passing values takes place in two stages. First, in the component that will accept the values, define input parameters, and then in the parent artifact map the appropriate data-passing components. The first stage may proceed differently, and its complexity depends on whether we only want to pass a value from component to component, or additionally want to make another action depend on that value, e.g. component visibility.

The general definition describing passing values to composite components can be found here: [Input parameters of the composite component](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/komponenty-rozszerzone/komponenty-zlozone.md#parametry-wejsciowe). However, special cases of passing values are not described there.

### Passing values directly <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazywaniewartosciwprost" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazywaniewartosciwprost"></a>

If we want to use the transferred data directly, i.e. only pass a value from one component to another (e.g. create a summary of the data entered in the application), then in the composite component receiving the values we need to define input parameters, i.e. indicate the components to which we will pass the value. To do this, in the left panel select the option **Input parameters**, and then **Add input parameter**. In the column **Request component** select the application field or session variable to which we want to pass the value:<br>

<figure><img src="/files/f81e221360aa4681d63822d0af3dee68f3e63d1f" alt=""><figcaption><p align="center"><em><strong>Figure 8.</strong> Example of defined input parameters for components and session variables</em></p></figcaption></figure>

After defining the input fields, save the composite component and open the artifact in which this component was embedded.

The next step is to map the values to the appropriate input fields, which should be done in the parent artifact relative to both composite components (the one passing and the one receiving the values). After selecting the artifact receiving the values, in the properties of that component click the option **INPUT PARAMETERS** and in the slide-out drawer set the sources of the retrieved values.

{% hint style="info" %}
If after clicking the property **INPUT PARAMETERS** the list of parameters is not visible, refresh the console window.
{% endhint %}

<figure><img src="/files/8341e69eaa1986e1c2c56b353c3e6029c648104b" alt=""><figcaption><p align="center"><em><strong>Illustration 9.</strong> Example of mapping parameters to components of the artifact passing values (e.g. GesComplexComponent1.GesTextField3) and session variables (e.g. imieNazwiskoPesel)</em></p></figcaption></figure>

### Passing a value to a session variable and further use of the passed value <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscidozmiennejsesyjnejidals" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazaniewartoscidozmiennejsesyjnejidals"></a>

If we want another action to depend on the value passed to a component, e.g. component visibility, requiredness, or displaying the value of a Value Selection Field in a label, the injected value should be passed to a session variable (instead of directly to the component).

The first stage, involving indicating the elements to which the values will be passed, should start by creating session variables. To do this, select the option in the left panel **Session variables** and click the button **Add session variable***.* In the slide-out panel, in the empty row created at the very top, set the name of the session variable (detailed instructions here: [Managing session variables](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md)). After creating the session variables, define value passing for them, which is done identically as for components (in the panel **Input parameters** indicate each session variable to which we want to pass a value).

Stage two, i.e. mapping the values to the appropriate input fields in the parent artifact, proceeds identically as for components (after selecting the artifact receiving the values, click the option in that component's properties **INPUT PARAMETERS** and in the slide-out drawer set the sources of the retrieved values).

Examples of using a value passed to a session variable are described in [Managing session variables](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/formularze/zmienne-sesyjne/zarzadzanie-zmiennymi-sesyjnymi.md) and below.

### Different examples of passing values <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-rozneprzykladyprzekazywaniawartosci" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-rozneprzykladyprzekazywaniawartosci"></a>

#### **Feeding a label (Text component) directly from another field**

* in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel **Input parameters**)*,*
* in the parent artifact map the appropriate component that is to pass the data to the label (property **INPUT PARAMETERS** of the composite component).

**Feeding a label from multiple session variables**

* in the artifact to which we want to pass the value, create session variables and set them as input fields (in the panel **Input parameters**),
* in the label we want to feed, in the property **Content** enter the variable names in the dollar sign {variable\_name} scheme (i.e. *${imie});* any content can be added before or after the reference to the session variable, e.g. *Ms. ${imie}*,
* in the label we want to feed, add listening on the variables used (section **Interactions**, button **List** in subsection **Listening**),
* in the parent artifact map the appropriate components that are to pass a value to the created session variables (property **INPUT PARAMETERS**).<br>

  <figure><img src="/files/0d6dc8a9a2bbba578a00afd7078b40f73ca1f34e" alt=""><figcaption><p align="center"><em><strong>Figure 10.</strong> Example of using session variables (first name and last name) in the "Label" component to pass a value</em></p></figcaption></figure>

#### **Feeding a label with the value of the "Value Selection Field" (Combobox)**

Feeding the label directly with a value from the Value Selection Field would result in displaying the key of the selected value, therefore the following instructions must be used:

* in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel **Input parameters**)
* in the parent artifact map the appropriate Combobox that is to pass the data to the label (property **INPUT PARAMETERS** of the composite component)
* in the XML source of the parent artifact, add **$label** after the id **of the Combobox** passing the value, i.e. if mapping has been set to *Combobox1,* then in the notation \<data:InputMapping componentId="**GesComplexComponent1.GesCombobox1**" alias="typDokumentuTozsamosci"/>) after the id enter *$label* (here "**GesComplexComponent1.GesCombobox1$label**")

#### **Feeding a label with a value from the Data component (DatePicker), Radio Group and others**

Feeding a label directly from Date will result in displaying the selected date value as a timestamp, therefore the following instructions must be used:

* in the artifact to which we want to pass the value for the label, define this label as an input field (in the panel **Input parameters**),
* in the parent artifact map the appropriate date component that is to pass the data to the label (property **INPUT PARAMETERS** of the composite component),
* in the XML source of the parent artifact, in the line responsible for mapping to the Data component, after the component id add ***$displayValue**.*<br>

The above instructions also apply to Radio Group, Product Selection and other components that pass a value, not displayed content, label or description. In the described way, the value can be passed to a label, but also to a Text Field component or Rich Text Content (TextContent).

**Feeding a session variable on another component with the value of a "Value Selection Field" (Combobox)**

If there is a need to feed a session variable or several components with the value of a Value Selection Field located in another artifact, the value itself, not its key, should be passed to that variable. To do this, it is worth creating a technical field, to which in the field **DATA SOURCE FROM ANOTHER FIELD** add **$label**. In this way the technical field already has the Combobox value and we can map this value to any artifact.

See also: [Input parameters of the composite component](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/komponenty-rozszerzone/komponenty-zlozone.md#parametry-wejsciowe).

{% hint style="info" %}
In one composite component, values can be passed directly to a component as well as to session variables. The method of passing depends on the further use of the injected values.
{% 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.eximee.com/documentation/documentation-en/budowanie-aplikacji/logika-biznesowa/przekazywanie-wartosci-miedzy-komponentami-lub-stronami-wniosku.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
