Example of connecting a service in a component
Feed component with a service
Below is how to feed a component with data retrieved dynamically from an external service. This way the options list will always be up to date and consistent with data from the external system.
Step-by-step configuration of the example component:
Selecting the component: To select the component, in edit mode open the form in Eximee Designer and select the component that should be fed from the service.
Selecting the data source: In the Properties panel you need to go to the Interactions section and find the field External data source. Then click the Select servicebutton. A window with a list of available services will open. In the search field enter part of the name to filter the list of services, then select the appropriate service from the list.

Illustration 1. External data source selection window after clicking the "External data source" field option "Select service" Description and version (optional): After selecting the service, a short description of the service's operation (if defined) should appear below the field, and the service version will be shown in a tooltip next to the name.
Invocation condition (optional): If the service should only be invoked in certain situations, define an invocation condition. To do this click the Add condition field and enter a conditional expression in JavaScript (you can use
getValue("ID_KOMPONENTU")). When the condition returns true, the service will be invoked.
Illustration 2. Example of an invocation condition for an attached service Caching results (optional): If the selected service returns static or rarely changing data (e.g., a country dictionary from a database), it is worth enabling caching. The Cache option is located next to the service definition – selecting it will temporarily save the service call result and reduce subsequent calls. Note: caching is recommended only for services that fetch dictionaries or other immutable data.
Mapping input parameters: Alternative text for the default value "Choose": Input parameters of the EDS configuration window should be assigned the required service input parameters from the form context. For each parameter you can choose an appropriate form component, a session variable, or enter a constant value. If the service accepts a list of values or multiple parameters at once, consider using the Select multiple option – it allows you to indicate several fields and add them sequentially (by clicking Add) to a single input parameter.

Illustration 3. Window for mapping multiple input parameters available after clicking the "Select multiple" option Mapping output parameters: Alternative text for the default value "Choose": Output parameters you should specify which output fields from the service correspond to which component attributes. The list of available attributes depends on the component type, and the list of parameters depends on the service definition. You should map, for example:
Value (id) – the identifier/key parameter returned by the service,
Label (text) – the parameter containing the name/description of the item to display,
Additional description (description) – the optional description parameter (second line).
For each assigned parameter you can optionally set a formatter – choose the formatter name from the list if the data requires formatting (e.g., date format, number masking).

Illustration 4. Example of mapping the output parameter "value" to the attribute "text" and attaching a formatter for the mapped value Applying the settings: After finishing the configuration you must save the changes. From that moment the component will be fed with data from the attached service. During form presentation Eximee will call the service and automatically populate the list of values.
Additional settings:
If the service returns an additional description for each item (attribute description), make sure that in the Styling section of the component the field Position of additional descriptionis set. Otherwise the additional description may not be visible.
If needed you can use the Simulation tab to attach a script simulating the service's behavior. This allows testing the form without access to a real backend – select an existing simulation script or add a new one in that tab.
The service can be removed from the component at any time – in the Interactions section click the trash icon next to the name of the attached service to detach the EDS.
Repeating section as a service input parameter
As an input parameter for the service you can provide the identifier of a field located in a repeating section. In that case the service will be sent a list of values of the indicated field from all rows of the section.
Last updated
Was this helpful?
