Configure Loops
Create loops to iterate over lists or arrays. Using the loop logical notation, you can create three different types of loops, namely For, Some, and Every.
- For: Iterates over a list and returns an array or a list containing the results.
- Some: Checks if at least one list item satisfies the test condition defined by an expression and returns a Boolean value.
- Every: Checks if every list item satisfies the test condition defined by an expression and returns a Boolean value.
To add a loop decision to the canvas and define its properties, see Add Decisions.
Follow these steps to configure the decision's logic:
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 shows a simple For loop that returns the squares of list items:
-
The following decision contains a Some loop that checks if at least one element in the list is greater than 50:
-
The following decision contains an Every loop that checks if every element in the list is greater than 50: