Generate Rows Tool

The Generate Rows tool creates new rows of data at the record level. Use this tool to create a sequence of numbers, transactions, or dates.

The Generate Rows tool follows a process to generate rows of data. That process consists of an initial expression (applied to record 1), then a loop expression is applied (such as an increment) that will build subsequent rows, based on a condition (true or false) that will ultimately build rows until the condition is false, when it will terminate the loop.

An input connection into this tool is optional, as indicated by the grey input connection arrow .

Configuration Properties

  1. Choose to update an existing field or create a new field.
  2. Specify the Initialization Expression to start the creation of rows. You can place a value here, create an expression, or click to open the Expression Editor.
  3. Specify the Condition Expression, where the condition is either true or false. If the condition is true, additional rows will be generated according to the Loop Expression (step 4), until the condition is false, at which time the generation of rows will terminate. Click to open the Expression Editor.
  4. Specify the Loop Expression, usually an increment of some sort, that will generate subsequent rows until the condition (step 3) is false. Click to open the Expression Editor.

 

Examples:

Create New Field Example: You'd like to create a new field to generate rows of data. You'd like to start with a value of one and incrementally add a value of 2, not to exceed a value of 10.

Initialization Expression: 1

Condition Expression: NewField<10

Loop Expression: NewField + 2

NewField

1

3

5

7

9

Update Existing Field Example: You have an input with 2 fields ("LOWRANGE" & "HIRANGE") that represent two values: a start and an end. You want to generate rows for all of the possible values between those two fields' initial values.

Initialization Expression: [Low Range]

Condition Expression: LOWRANGE<=[HIRANGE]

Loop Expression: LOWRANGE+1

BEFORE: LOWRANGE

BEFORE: HIRANGE

1

5

6

10

11

15

AFTER: LOWRANGE

AFTER: HIRANGE

1

5

2

5

3

5

4

5

5

5

6

10

7

10

8

10

9

10

10

10

11

15

12

15

13

15

14

15

15

15

Be sure to configure the Condition Expression so that the Generate Rows tool will TERMINATE at some point. Hard drive space can fill up fast if you are not mindful of this setting!

Common Errors

It can be easy to configure the Generate Rows tool incorrectly. A common error returned from an incorrect configuration is:

● GenerateRows (5): The value did not change after the Loop Expression.

This error is easily avoided by including the New Field/Existing Field specified in Step 1 in the Loop Expression.

Because this tool includes an expression editor, an additional input anchor displays when the tool is used in an app or macro workflow. Use the Interface tools to connect to a Question anchor. See Interface Tools.