Example of wiring a service in a component

Feeding a component with a service

Below is how to feed a component with data dynamically retrieved from an external service. This ensures the option list is always up to date and consistent with data from the external system.

Step-by-step configuration of an example component:

  1. Selecting the component: To select a component, open the form in edit mode in Eximee Designer and select the component that should be fed from the service.

  2. Choosing 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 the list of available services will open. In the search field type part of the name to filter the service list, then choose the correct service from the list.

    Figure 1. Window for selecting an external data source after clicking the "External data source" field option "Select service"
  3. Description and version (optional): After selecting a service, a short description of the service's behavior (if defined) should appear below the field, and the service version should be shown in a tooltip next to the name.

  4. Invocation condition (optional): If the service needs to be called only in specific situations, define an invocation condition. To do this click the Add condition field and enter a conditional expression in JavaScript (you can use getValue("COMPONENT_ID")). When the condition returns true, the service will be invoked.

    Figure 2. Example of an invocation condition for a bound service
  5. Caching results (optional): When the selected service returns static or rarely changing data (e.g., a country dictionary from the database), it is worth enabling caching. The Cache option is located next to the service definition – selecting it will temporarily store the service call result and reduce subsequent calls. Note: caching is recommended only for services fetching dictionaries or other immutable data.

  6. Mapping input parameters: In the Input parameters tab of the EDS configuration window, assign 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, use the Select multiple option – it allows you to point to several fields and add them one by one (by clicking Add) to a single input parameter.

    Figure 3. Window for mapping multiple input parameters available after clicking the "Select multiple" option
  7. Mapping output parameters: In the Output parameters 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 parameter for an optional description (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).

    Figure 4. Example of mapping the output parameter "value" to the "text" attribute and attaching a formatter to the mapped value
  8. Applying the settings: After completing the configuration, save the changes. From that moment the component will be fed with data from the bound service. During form presentation Eximee will call the service and automatically populate the value list.

  9. 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 Additional description itemis set. Otherwise the additional description may not be visible.

    • If necessary, you can use the Simulation tab to attach a script that simulates the service behavior. This allows testing the form without access to a real backend – choose 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 bound service to detach the EDS.

Repeatable section as a service input parameter

As an input parameter for the service you can provide the identifier of a field located in a repeatable section. In that case the service will receive a list of values of the indicated field from all rows of the section.

Last updated

Was this helpful?