| Change type | Description |
|---|---|
| Introduced in version 3.18 | A new Do While Conditional node with support for script free loop control is now available for use in data flows. |
Executes a user-defined Python script expression and passes the result to an optional execution path, looping while the specified condition is met.
To use this node, start by connecting the input data to the initialInput input pin, which provides the initial input into the Do While Conditional loop.
Write the while condition and select the row to check against this condition.
Connect the outputToLoop and inputFromLoop pins to a chain of nodes to execute during each loop iteration. These pins may be connected directly to each other if all of the data manipulation occurs in the Script.
Finally, connect the finalOutput pin to the rest of the data flow.
Each row of the data connected to the initialInput pin is read. If there is data on the inputFromLoop it is used instead.
The Expression and the ContinueLooping are evaluated and if the condition is matched, the data is passed to the outputToLoop pin, otherwise the data is passed to the finalOutput pin
The chain of nodes connected to the outputToLoop pin is executed, and the process begins again.
Properties
ContinueLooping
Optionally specify which row of data on the inputFromLoop pin to validate against the while condition. Choose from:
- Any Records Match - the node will continue looping while any row meets the while condition.
- All Records Match - the node will continue looping while all rows meet the while condition.
- First Record Matches - the node will continue looping while the first row meets the while condition.
- Last Record Matches - the node will continue looping while the last row meets the while condition.
Alternatively you can specify the specific row to validate against. The default value is Any Records Match.
Expression
To define the loop condition, specify one or more filter criteria groups, each consisting of one or more rows of filter criteria. These criteria must be met for the node to continue looping. A value is required for this property.
This property is identical to the Filter node’s Filter property, except it controls loop continuation instead of filtering records. For description of fields in the Expression property, see Filter properties.
Example: Continue looping while input row field count is less than 10.
fields.count < 10A value is required for this property.
Specify a Script expression that must be met for the node to continue looping.
'count' < 10 AccumulateLoopOutput
Optionally specify whether to include the output from each pass through the loop in the final output.
The default value is False.
For example, assume the following:1. The loop increments the input field 'count' by one each pass through the loop.2. The loop will terminate once 'count' equals five.3. The input pin has a single row like so:
|count|
| 1 |
If AccumulateLoopOutput is false, the final value in the 'count' column is 5 and there is only one row:
|count|
| 5 |
If AccumulateLoopOutput is true, a row is added for each pass through the loop:
|count|
| 1 |
| 2 |
| 3 |
| 4 |
| 5 |
Example data flows
A number of sample Data Flows are available from the Samples workspace, found in the Analyze Directory page.
In the Directory under the /Data360 Samples/Node Examples/ folder, you will find "Looping with Do While nodes", which shows examples of how to use this node.
Inputs and outputs
Inputs: initialInput, inputFromLoop.
Outputs: finalOutput, outputToLoop.