Get service items

See also: Contained in service items, Data service update

The Behaviour type Get service items returns the current data service records as a list for an item in the group of List elements.

images/download/attachments/189431982/image-2024-9-30_12-5-20-version-1-modificationdate-1727690719273-api-v2.png

  • If no element is linked, the service entries of the executing element are evaluated.

  • If an element is linked, the service entries of the linked element are evaluated.

If the respective element does not belong to the group of List elements, no actions are executed.

If the respective element belongs to the group of List elements, but does not currently contain any service entries, an empty array is passed to the Actions on 'true'.

IMPORTANT◄ The Behaviour type only returns the entries currently loaded locally into the element by the data service. If the service configuration settings include paging ('Max. results' per loaded page), search restrictions, etc., these may affect the return value. Stable results can only be expected if a data service is used that does not use paging but always provides all configured entries 'statically' (e.g. based on a dynamic enumeration).

Example

A sales employee is required to nominate one of his customers every month as a 'favourite customer' via a portal based on subjective criteria. On the basis of turnover criteria, which will not be discussed in detail here, the system makes a certain pre-selection and offers a maximum of 10 candidates to choose from. Against this background, when a selection is made, it should also be recorded from among how many qualified candidates a 'favourite customer' was selected.

Runtime example:

images/download/attachments/189431982/image2020-5-22_13-25-55-version-1-modificationdate-1727690471876-api-v2.png

Configuration:

images/download/attachments/189431982/image-2024-10-23_16-15-22-version-1-modificationdate-1729692921538-api-v2.png

The pre-selection in the system for the most qualified candidates is defined by the service configuration for the 'Candidates' Combobox. This selects a maximum of 10 Company accounts on the basis of criteria not described in detail here, which are offered for selection in the portal via the 'Options' display type.

  • A behaviour is configured for this element that reacts to the Triggering event Changed (with all Change types).


  • The Behaviour type Get service items does not use an element link, since the executing element ('Candidates') is evaluated.


  • Under the Actions on 'true', a Set value action is executed, which evaluates a calculation expression as a value, which links the following information and returns it in a text field ('Vote: ...') provided for this purpose:

    • The function get (Read value from data field) obtains the currently changed value from the Combobox. This was available as $input until the behaviour type was executed, but was then overwritten with a list of entries ('Candidates').

    • The ifNotEmpty function ensures that the following information on the number of candidates is only provided if a selection was actually made.

    • The access to the field {length} refers to the return value ($input) of the behaviour type, so it returns the number of listed candidates.