Define Interface Properties, Functions, and Events in Composites

As a composite developer in SAP Analytics Cloud, in advanced mode, you can define interface properties, functions, and events that are exposed to story designers and developers for them to customize and add scripts to your composite.

Define an Interface Property

You can define an interface property and link it to the view time visibility or elements of widgets in your composite, so that story designers can further customize the composite based on the story context.

To add an interface property, in the Interface section of Outline, select (Add Interface Property) to the right of Properties.

The Interface Property panel opens, where you can configure the following details:
  • Name

  • Type, either string or boolean

  • Description, which can tell story designers what the property is about

  • Whether to enable its script access

    If you select Enable scripting access, when writing scripts in your composite, you can access the interface property by its name and use it according to its type. By default the option is off.

  • Linked widgets or elements

    • For a boolean property, you can select linked widgets. Story designers can then set the property value to set the view time visibility of the selected widgets from the composite.

    • For a string property, you can select linked widget elements, for example, chart title or hyperlink URL. Story designers can then set the property value to display the text on corresponding widgets in the composite.

      The following widget elements are available for you to select:

      Widget

      Available Elements

      Text

      Content

      Chart

      Title, subtitle

      (Applicable to mobile app or external URL) Hyperlink URL, hyperlink label

      Table

      Title

      (Applicable to mobile app or external URL) Hyperlink URL, hyperlink label

      Button

      Text, tooltip

      Dropdown

      Tooltip

      Checkbox group, radio button group

      Label text

      Input field

      Display hint

      Data action starter, multi action starter, BPC planning sequence starter

      Label, description

      Image

      (Applicable to mobile app or external URL) Hyperlink URL

      Shape

      (Applicable to mobile app or external URL) Hyperlink URL

    Once the element or view time visibility of a widget is linked to the interface property, you can find the indicator in the widget's configuration panel or dialog.

Define an Interface Function

You can define an interface function, so that story developers can use it in stories.

To add a script function, in the Interface section of Outline, select (Add Script Function) to the right of Functions. Then, configure the script function in the panel, and edit scripts by selecting (Edit Scripts) to the right of the function.

For how to create a function, you can refer to Use Script Objects.

Define an Interface Event

You can define a script event for your composite, so that in stories story developers can write scripts for the composite.

To add a script event, in the Interface section of Outline, select (Add Script Event) to the right of Events. You can enter a name for the event.

Then, you can use the following API to the initiate the event:

In stories, the event'll be displayed when story developers select (Edit Scripts) to the right of the composite in Outline.

In addition, in the Scripting section of Outline, you can add script variables and script objects, which can be reused in scripting in the composite. You can also add scripts to the widgets in the composite. With scripts available, the composite itself has customized interactions and custom logic.