While Loop

Execute a given conditional PQL expression repeatedly, until the condition resolves to false. The loop will run continuously as long as the given PQL condition is met; once the condition is not met, the loop will stop running.

During each iteration of the loop, the condition is checked: if true, the loop will continue running; if false, the loop will stop running and the flow will continue to the next node outside of the loop.

While Loop Properties

Display Name

The default display name of the for loop node is While Loop 1. Any subsequent for loop nodes are named according to this naming convention, with the appropriate numeric suffix, e.g. ' While Loop 2', ' While Loop 3', etc.

You can change the while loop node name from directly from this field.

Description

You have the option to add a description to each for loop node; this can be a useful way of documenting the node for yourself and other users.

Condition Expression

Write your conditional PQL expression.

PQL Expressions

The While Loop runs based on a given PQL expression. You can construct a PQL expression by writing or pasting it directly into the Switch Expression field, or by opening the PQL Editor.

The while loop supports the use of the 'Common' PQL functions; when you open the PQL Editor, the Common PQL functions will be exposed, along with any variables that you've created within the flow.

To open the PQL Editor, click the PQL icon from the Condition Expression field.

Condition PQL Functions

To use the While Loop, you must create a conditional PQL expression that returns a boolean (like true or false). Often this will reference a variable, and the loop will be defined according to the value of the variable. For example, if the statement is @Variable > 9 the loop will run until the variable value is greater than 9.

Example

In this example, the loop will run until the value of the given variable exceeds 100:

In this example, the Data Flow contains a variable that stores the row count for a given table. The loop will run until the RowCount variable exceeds 500:

  • Click here to review documentation of the PQL Common functions.
  • Click here to learn more about the PQL editor.
  • Click here to learn about PQL syntax.
  • Click here to learn more about PQL.