Execute Loops in Events
Use loops within Events in form controls to execute actions that need to iterate. The iterator can be a number or an array. Loops are a way to execute the same action multiple times in a form.
Let us explore with some examples how loops work in forms.
Example of a Simple Loop
In this example, let us add multiple rows to a table by configuring a simple loop with a number iterator.
-
Drag and drop a table control onto your form’s canvas. Then drag and drop an InputText control in the table’s column.
-
Select the table control, and in the properties pane that displays scroll down till you find Events. Click Add to configure an event for the control.
-
Select On Load from the drop-down list, and then click the editing icon.
-
In the event On Load window, click Loop. Select Constant in the Type drop-down list, and enter a number in the Value field, for example: 5. This value determines the number of times looping occurs when the form loads.
-
Click +Actions. In the Control drop-down list select Table, and in the Action drop-down list select Add Row.

Description of the illustration loop-example1.pngWhen the loop executes (on form load), the Add Row action gets executed 5 times.
-
Click OK.
-
Preview the form and see how it works.
Note that 5 rows get added to the table as the form loads.
To see how the loop executed, click Log in the Preview window.
Example of a Loop with an Array
In this example, let us configure a loop with an array of strings.
-
Drag and drop a table control onto your form’s canvas. Then drag and drop an InputText control into the table’s column.
-
Select the table control, and in the properties pane scroll down till you find Events. Click Add to configure an event.
-
Select On Load from the drop-down list, and then click the editing icon.
-
In the event On Load window, click Loop. Select the type as Data Definition in the Type drop-down list, and enter the value as list in the Value field.
Note that list is already defined as an array of strings.
-
Click +Actions. From the Control drop-down list, select Table. From the Action drop-down list, select Add Row.
-
Configure another action. Click +Actions.
-
Select Table in the Control Name drop-down list, and specify Last in the Which? field.
-
In the Control Name that displays, select InputText, and then select Value in the Action drop-down list.
-
In the Type field that displays, select Loop, and then select Value from the Value drop-down list.

Description of the illustration loop-example2.pngNote that the Loop type can have three options as value.
- Index: 0-based index of the iteration (0, 1, 2, 3...)
- Position: 1-based index of the iteration (1, 2, 3, 4...)
- Value: The value of the current iteration. If the iterator is a number, this value will be same as Index.
-
-
Click OK.
-
Preview the form and see how the loop works.
-
In the Preview window, click Reload with Payload.
-
In the Custom Payload window, specify an array, and click OK.
-
You can see that the loop executes with the specified array.
On form load, the table displays two rows with the values (red, blue) specified in the array.
-
