Docs Menu
User Guide / Control Structures / Loops

Loops Step

We already know that looping in programming languages is a feature that facilitates the execution of a set of instructions/functions repeatedly while some condition evaluates to true. Syncloop API Development Platform provides looping control structures also. These loops are used to traverse through the lists that as specified as Input Lists and iterate till the end of the list is not reached. Any variable can be converted into an array by clicking on the array property in the properties option of the variable/element. To create a new loop right click on the workspace and select Loops

Root Properties

Properties of Loop

Right Click on the loop and select properties, the properties dialog will be displayed.

Root Properties

It has six main properties

Status: To enable/disable the Loop Block. The default status will be in enabled mode. If the status is selected as disabled in the case switch & its child cases and further steps will not execute when the API will be invoked either from HTTP or from another service.
Snapshot: Create a runtime data state snapshot for the Loop step.
Comment: Add comment to the Loop Block.
Input List: The input list (in the form of the array) will be given as input. The value of the input list will be the XPath of the variable. The loop will always work on the input list and will traverse each element of the list (Array). This array is specified as the input parameter.
Output List: The output list (in the form of the array) will be generated from the input list. The value of the output list will be the XPath of the variable and is specified as the output parameter. The only consideration that has to be kept there is that the list/array should not have existed before in the service or else this will create a conflict.
Type: This describes the type of the list. This list type will be applicable to Input List. This type can include Document, Object, String, Integer, Boolean, Number, Byte, and Date.

To know more about loops, watch this video