Looping through Seed Data

Document created by Dave Murphy Employee on Jul 19, 2017
Version 1Show Document
  • View in full screen mode

It is possible to loop through Seed Data with a For Each loop within a clip:

 

 

 

The row count should match up to the number of rows you want selected on each fetch.  

Each time you fetch from seed data N rows of data will be selected each time.   Depending on your EOF action will determine what happens when you run out.  So if you had 30 rows in this example you would hit that row limit in 2 iterations of the main loop itself.   This means you would either tell it EOF action to wrap, stop track and drain, return NULL or some other method.

 

Note:  if you want all the data in the table each time then you need to adjust the number of rows to match the table row length.

You will need to manually update the Row Count each time the clip is run. (Red Arrowed piece).

 

Also, remember to select the property within the current Group, it will be ForEachValue[columnNum] or ForEachValue.columnName.

 

 

The best practice would be looping the Seed Data at the Track Level:

 

First, we eliminate the For Each loop and retain the usual clip.  Next, for the seed data property change the following settings:

 

 

NOTE:  

EOF Actions:  

Stop Composition ->  Will return a Stopped Result and mention because it reached the end of Seed Data file.

Stop Track and Drain ->  Wil try to run the track one last time, and when it has reached the end it will return a Completed Result.

 

Finally, at the track level select the User icon until a loop appears:

 

 

With these settings, it will loop through the clip and pull in a new row of values sequentially each iteration and stop when it reaches the end of the seed data repository.  The EOF actions can be changed as well as the Row traversal type to suit your needs.

 

NOTE: Using Preview Mode is highly recommended when involving Seed Data.  It will allow you to see which values will be used when run.

Attachments

    Outcomes