Attaching a service at the page or entire request level
Example of attaching a service
Besides the standard attaching of services to individual components, Eximee enables defining services at the page or request level. They are used to supply data to many fields at once or to perform operations on request entry/exit. For example, one can define a service PageService for a page with the client's address, which after entering the postal code will automatically fetch and fill in the town and voivodeship in other fields. Another case is EntryService run when the request is opened – e.g. fetching the client's basic data and filling the form with it.
Step-by-step configuration:
Adding a service at the form level: First, you need to register the appropriate service in the request context:
Page service (PageService): To add a page service, open the tab Page services located on the left side of the editor view.
Incoming/outgoing request service (Entry/Exit Service): In the tab Properties for the entire request, add the service as a Entry service (executed when the request is opened) or Exit service (executed when the request is completed or submitted).

Figure 1. The selection window for the service defined for the page (a narrowed list to PageServices available on the request)
Attaching a service to a component: Then select the component that should display data coming from the selected service (e.g. the Client town field). In its properties, in the section Interactions, you need to use the field External data source – click Choose service and search the list for the previously created service. Then select the appropriate Page or Entry service from the list.

Figure 2. Selection window for the service output parameter Mapping results: After selecting the service, go to the tab Output parameters. From the available data returned by the service, select the appropriate output field and map it to the component attribute. For example, the PobierzDaneKlientaService service can be mapped so that the attribute value of the Town field receives the value from the clientCity parameter returned by the service.
Input parameters (if required): If the page/request-level service requires input parameters (e.g. postal code as input to PageService), these parameters should be linked in the EDS input configuration. By default, listening to the components indicated in the input parameters will be set up.
Data refresh on change: Thanks to the listening mechanism, if the value in the service input field (e.g. postal code) changes, the linked Page/Entry service will be automatically invoked again, and the dependent components refreshed. The user does not need to take any additional action – the form will automatically keep the data up to date.
Last updated
Was this helpful?
