Declare a Preference Service
Configure properties with an expression to fetch values dynamically from a REST service.
You can declare a preference service to fetch values dynamically from a REST service that can then be used in preference expressions in properties like Default Value and Validation Rule. A preference service is a business object that supports GET at the collection level plus an optional query string. This feature allows an integrated workbook to behave differently at different customer sites or even, potentially, for different business users depending on the query used.
Configure a Preference Service
Define a preference service in the Business Object catalog.
Note:
There is no support for:- Object-based fields and their subfields.
- Child business object and/or polymorphic business objects such as DFF.
Add a Preference Expression to a Property
Enter an appropriate preference expression in a property that supports preference expressions. For example:
Apply Preference Values
The timing of the expression evaluation is unchanged from previous releases. Refer to the existing documentation for details for each of the supported properties.
- The add-in performs a GET request on the target preference service including the optional query string (if specified).
- The add-in includes limit = 1 on the request so that the service returns only one row.
- If the request is successful, the add-in harvests the field values for the first item in the response.
- The add-in caches these values in memory and reuses them for the remainder of the workbook session.
- If the workbook is closed and reopened, the add-in fetches a fresh copy of the preference values from the service.
- The expression is replaced with the field value from the preference service.
Error Handling
- If the expression contains an invalid service id or field id, the result is an error that interrupts the current operation.
- If the attempt to fetch the values fails, the result is an error message that does not interrupt the current operation. The add-in does not reattempt the fetch for the remainder of the workbook session.
- If the GET request returns zero rows or the target field is missing from the response, there is no error. The expression is replaced with a null value.
- You can use the add-in's Network Monitor to view the details of the GET request to the preference endpoint.

