Creating loops
In this section, we will learn techniques for performing process iterations and multiple iterations of data lists.
Loops are used when we want to iterate something. For example, if we have a list of records that we want to go through to manipulate data or calculate a result, we use a loop.
We can do this in OutSystems in two ways:
- For Each – For Each is an artifact that traverses a given list, so the list has to be defined before using the artifact. For that, For Each has three attributes: the list that we are going to iterate, its Start Index, and the Maximum Iterations. In cases of simple lists and without association references with other widgets (such as being used to feed a frontend table) the parameters of Start Index and Maximum Iterations can be left undefined, in which case, the entire list will be iterated. We must always consider that a list that is already being iterated by a For Each cannot be iterated inside that same loop, that is...