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.

  1. Click Manage Catalogs.
  2. In the Manage Business Object Catalogs window, select and edit the catalog where you want to define a preference service.
  3. In the Preferences tab, click Add Preference Service ( Add Preference Service ) and click Edit Preference Service ( Edit Preference Service ) to open the Preference Service Editor.
  4. In the Preference Service Editor, provide an arbitrary ID to use later in expressions.
    • The value must be unique within the current catalog.
    • Use a short value that does not contain any special characters.
  5. Click Choose a business object ( Choose a business object ) to select a business object. If your catalog does not yet include the desired business object, you can add it. See Add Business Objects to an Existing Catalog.
  6. Provide an optional query string (for example: q=id=432) that:
    • Conforms to the expected syntax of the service.
    • Does not include the ? character.
    • Includes the encoded value if any characters require URL encoding.

    Preferences Service Editor

Note: There is no support for:

Add a Preference Expression to a Property

Enter an appropriate preference expression in a property that supports preference expressions. For example:

  1. Click Designer.
  2. In the Columns tab of the Layout Designer, select the field that you want to edit, and click Edit the selected column ( Edit the selected column ) to open the field editor.
  3. In the editor, click Edit in Expression Editor ( Edit in Expression Editor ) in the Default Value field and, in the Expression Editor that opens, select the Preferences template ({ Preferences['<serviceId>'].Fields['<fieldId>'].Value }) from the Values menu.

    Expression Editor

  4. In the Available Preference Fields window that opens, select the preference service that you configured from the Choose a Preference Service list, and then a field from the service.

Apply Preference Values

The add-in evaluates a preference expression when it evaluates the property that contains the expression.

Error Handling