> 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 components or request pages

Platform **Eximee Designer** allows passing values from one component to another. Depending on whether the components are in the same artifact or in two different ones, value passing is done 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 values 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 (TextField) to another or to another component, e.g. to the content of a statement 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* (choose in the section **Interactions** in the field **EXTERNAL DATA SOURCE** option **Select a service** and indicate this script), where you need to specify the transmitting component as input. In the script output parameters, the script output must be mapped appropriately to the component attribute. This approach additionally gives us the ability 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 attached "EchoServiceScript" script</em></p></figcaption></figure>
* Select in the field **DATA SOURCE FROM ANOTHER FIELD** data-transmitting component:

<figure><img src="/files/3d952e0e11fa0d7dccfabc18eecd57b0b97fa96f" alt=""><figcaption><p align="center"><em><strong>Figure 2.</strong> Setting as the data source of 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 component passing the data):<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 for 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 instruction to the value selection field/Date (and other components that pass a value, not the displayed content, label or description) would result in passing the value of that component. To pass the text (description or label), you need to:

* if we want to pass the content (label or description) through **DATA SOURCE FROM ANOTHER FIELD**, instead of selecting the data-transmitting component there enter:<br>
  * for the value selection field (Combobox) add after its id **$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) add after its id **$displayValue**, e.g. *GesDatePicker1$displayValue*
* if we want to use the content (label or description) in the content of another component (e.g. in the section title, add it to 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 appended *$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 appended *$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>

In a situation where the components are not in one artifact (the same composite component), the values need to be injected into the target artifact. It does not matter whether both composite components are located on the same application form page.

Passing values takes place in two stages. First, in the component that will receive the values, input parameters must be defined, and then in the parent artifact the appropriate data-transmitting components must be mapped. The first stage can proceed in different ways, 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 a composite component](/documentation/documentation-en/budowanie-aplikacji/interfejs-uzytkownika/komponenty-rozszerzone/komponenty-zlozone.md#parametry-wejsciowe). However, special cases of value passing are not described there.

### Direct value passing <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazywaniewartosciwprost" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-przekazywaniewartosciwprost"></a>

If we want to use the passed data directly, i.e. only pass a value from one component to another (e.g. create a summary of data entered in the application), then in the composite component receiving 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 form 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 is 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 transmitting and the one receiving the values). After selecting the artifact receiving the values, in that component's properties click the option **INPUT PARAMETERS** and in the drawer that slides out set the sources of the values to be retrieved.

{% 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 transmitting artifact (e.g. GesComplexComponent1.GesTextField3) and session variables (e.g. imieNazwiskoPesel)</em></p></figcaption></figure>

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

In a situation where we want another action to depend on the value passed to a component, e.g. component visibility, requiredness, or displaying the value of the 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, consisting of indicating the elements to which the values will be passed, should be started by creating session variables. To do this, in the left panel select the option **Session variables** and click the **Add session variable***.* button. In the slide-out panel, in the empty row created at the very top, set the session variable name (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 exactly like for components (in the panel **Input parameters** indicate each session variable to which we want to pass the value).

Stage two, i.e. mapping the values to the appropriate input fields in the parent artifact, is done exactly like for components (after selecting the artifact receiving the values, click the option in that component's properties **INPUT PARAMETERS** and in the drawer that slides out set the sources of the values to be retrieved).

Examples of using the 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.

### Various examples of value passing <a href="#przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-rozneprzykladyprzekazywaniawartosci" id="przekazywaniewartoscimiedzykomponentamilubstronamiwniosku-rozneprzykladyprzekazywaniawartosci"></a>

#### **Populating 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 data to the label (property **INPUT PARAMETERS** of the composite component).

**Populating a label from several 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 populate, in the property **Content** enter the variable names in the dollar-sign{variable\_name} pattern (i.e. *${imie});* any content can be added before or after the reference to the session variable, e.g. *Mrs. ${imie}*,
* in the label we want to populate, add listening for the used variables (section **Interactions**, button **List** in subsection **Listeners**),
* in the parent artifact map the appropriate components that are to pass 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>

#### **Populating a label with a "value selection field" (Combobox) value**

Populating a label directly with a value from the value selection field would result in displaying the key of the selected value, therefore it is necessary to apply the following instruction:

* 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 data to the label (property **INPUT PARAMETERS** of the composite component)
* in the parent artifact's xml source, add **$label** after the id of the **Combobox** transmitting 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**")

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

Populating a label directly from Date will result in displaying the selected date value as a timestamp, therefore the following instruction is necessary:

* 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 data to the label (property **INPUT PARAMETERS** of the composite component),
* in the parent artifact's xml source, in the row responsible for mapping to the Data component, add after the component id ***$displayValue**.*<br>

The above instruction also applies to Radio Group, Product Choice and other components that pass a value, not the 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 Formatted Content (TextContent).

**Populating a session variable in another component with a value from a "value selection field" (Combobox)**

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

See also: [Input parameters of a 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 way the value is passed 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
