Configure Lists

A list notation is a vertical list of elements, where each element is an independent logical notation. The output of a list notation contains outputs of all its elements. You can also invoke the output of a particular list element from another decision.

To add a list decision to the canvas and define its properties, see Add Decisions.

Follow these steps to configure the decision's logic:

  1. Double-click the list node to access its logic editor.
    Alternatively, select the node, and click Edit or View Decision Logic icon on the sidebar.
  2. Click Add item Add icon to create a new list item.
    An item is created with the expression notation selected by default.
  3. To change the logical notation for the list item, click Options icon, select Change Value, then select a different notation from the available options.

    Note:

    If you add a function as one of the list items, the list notation as a whole doesn’t return an output. However, you can invoke results of individual list items throughout the decision model.
  4. Configure the logic for the list item according to the selected notation. You can use input variables or built-in functions to define the logic.
  5. Similarly, add as many list items to your decision as needed.
  6. Additionally, you can move or replicate a logical notation and its contents between list items. Click Options icon in a list item's row and select the required action.
  7. To reuse the entire logic definition in another decision, cut or copy it and paste it into the desired decision. Click Options icon in the header and select the required action.
  8. To delete a list item, click Options icon in its row and click Delete.
Changes you make within the decision model are automatically saved and validated. Errors and warnings, if any, are displayed in the editor. Click the error or warning icon to review and fix them. See Review and Fix Errors in a Decision.

The following example is a list of simple expressions, containing prime numbers that are less than 10.

The image shows a List decision called Prime Numbers. The values entered for list entries from top to bottom are: 2, 3, 5, and 7. There is an Add item button at the bottom of the image.

According to the FEEL syntax, you can also define horizontal lists in expression fields across all decision types. For example, a list of all prime numbers less than 10 can be defined as: [2,3,5,7].

In a list of n elements, use <list_name>[n] to invoke the nth element from the beginning of the list, and use <list_name>[-n] to invoke the nth element from the end of the list. In this example, to invoke the list entry of 2, you can either use Prime Numbers[1] or Prime Numbers[-4].

Additionally, you can use built-in functions on a list decision within other decisions. For example, the following expression decision returns the sum of all items in the Prime Numbers decision.

The image shows an Expression decision called Sum. The value entered in the expression field is sum(Prime Numbers).