Show TOC

Example: Creating a FunctionLocate this document in the navigation structure

Create a function that returns a list of table values to populate a listbox object (labelled obj_c1tlb).

Context

Functions allow you to automate common calculations, such as taking the average value of a table column and adding the values of multiple data attachments.

There are several functions grouped into two categories, Scalar Functions and Tabular Functions, that act on scalar and tabular data, respectively.

From the Display Builder:

Procedure

  1. Select Start of the navigation path Tools Next navigation step Functions End of the navigation path, or click the Functions tab at the bottom of the Display Builder window, and click Add.
  2. Enter a name for the function and choose an appropriate function type. For example, choose Count Unique Values to return a list of unique values from a column in a table or stream. If you select this function, you are prompted to specify a table or stream column.
  3. Right-click the Table Column field and select Start of the navigation path Attach To Data Next navigation step ESP End of the navigation path. Choose a connection to the Event Stream Processor stream name and a column defined in the stream.
  4. Create a listbox object in the Controls tab of the Object Palette.
  5. Right-click the listValues property of the listbox object properties, and select Start of the navigation path Attach To Data Next navigation step Functions End of the navigation path. Choose the function you created in step 2 and select Value in the Columns field to bind the function to the listbox object.
    Whenever a new value appears in a column in the stream that the function has been attached to, that value also appears automatically in the listbox object.
  6. Set the selectedValue and varToSet properties of the listbox object so the selections made in the listbox can be used elsewhere, such as for publishing to Event Stream Processor.