For Each Element

Allows building loops to perform some piece of logic for each element of the collection or element of the array in input.It has two output control ports – loop body and completed. Control flow will keep coming back to this operator until all the elements in the input have gone through the same path down the loop body port. When finished with all the entities or when there are no entities in the input, it runs the control flow to the control flow link that is connected to its completed control port.

Please see For Each Entity for a detailed description of how loops work. The difference between For Each Entity and For Each Element is that For Each Entity works only with Entities as input (runs the loop for each record), while For Each Element works only with Collection or Array as input (runs the loop for each collection element or each element of the array).

inputs:

elements – input collection or array to walk through in the loop. Arrays elements are usually obtained from Get Array Elements By Path:

Collection usually comes from Create Collection operator or Split String Into Collection:

break  – connect control flow to this port, in order to break from the loop and move onto the operator, pointed to by ‘completed’ control flow output. This port is often connected to one of the outputs of a Branch inside this loop’s body.

outputs:

completed – flow goes here and proceeds to the following operators once the operator runs out of elements in the input or when ‘break’ control flow input is reached.

loop body – flow goes here and proceeds to the following operator for each element in the elements input until either all of the elements are processed, or when ‘break’ control flow input is reached. After that, control flow proceeds via ‘completed’ port.

element – one given element of the Collection or Array in the input of the current step of the loop.

Click to rate this post!
[Total: 0 Average: 0]

Leave a Reply

Your email address will not be published. Required fields are marked *